ci: standardize workflows (Odoo 18) - Clean & Fix Remote URL
This commit is contained in:
parent
0e06f6c8cd
commit
0b85f6a418
|
|
@ -119,7 +119,7 @@ jobs:
|
||||||
# Better to assume the setup script handles it, or handle it here:
|
# Better to assume the setup script handles it, or handle it here:
|
||||||
cd "$TARGET_DIR"
|
cd "$TARGET_DIR"
|
||||||
git init
|
git init
|
||||||
git remote add origin git@github.com:hydracp9/odex30_standard.git
|
git remote add origin git@github.com-odoo18:hydracp9/odex30_standard.git
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "$TARGET_DIR"
|
cd "$TARGET_DIR"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
name: Restrict PR Authors
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, reopened, synchronize]
|
||||||
|
branches:
|
||||||
|
- '**' # Apply to all PRs in this repo
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check_pr_author:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Validate PR Author
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
// TODO: Add your team members here
|
||||||
|
const allowed = [
|
||||||
|
"hydracp9",
|
||||||
|
"eltayar", // Added for testing/dev
|
||||||
|
// "another-client-user"
|
||||||
|
];
|
||||||
|
|
||||||
|
const prAuthor = context.payload.pull_request.user.login;
|
||||||
|
|
||||||
|
core.info(`PR Author: ${prAuthor}`);
|
||||||
|
|
||||||
|
if (!allowed.includes(prAuthor)) {
|
||||||
|
core.setFailed(`⛔ Unauthorized Access: User '${prAuthor}' is not in the allowed list.`);
|
||||||
|
|
||||||
|
// Optional: Close the PR automatically
|
||||||
|
try {
|
||||||
|
await github.rest.pulls.update({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
pull_number: context.payload.pull_request.number,
|
||||||
|
state: "closed"
|
||||||
|
});
|
||||||
|
core.info("PR has been closed automatically.");
|
||||||
|
} catch (e) {
|
||||||
|
core.warning("Failed to close PR automatically.");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
core.info("✅ Authorized.");
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue