Skip to content

Commit 102be7b

Browse files
fabiobaltierinashif
authored andcommitted
scripts: do_not_merge: take a repo and org argument
Take a repo and org argument to the do_not_merge.py script so it can be used in the testing repository. Signed-off-by: Fabio Baltieri <[email protected]>
1 parent 09634c9 commit 102be7b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.github/workflows/pr_metadata_check.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,7 @@ jobs:
3636
env:
3737
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3838
run: |
39-
python -u scripts/ci/do_not_merge.py -p "${{ github.event.pull_request.number }}"
39+
python -u scripts/ci/do_not_merge.py \
40+
-p "${{ github.event.pull_request.number }}" \
41+
-o "${{ github.event.repository.owner.login }}" \
42+
-r "${{ github.event.repository.name }}"

scripts/ci/do_not_merge.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def parse_args(argv):
2929
)
3030

3131
parser.add_argument("-p", "--pull-request", required=True, type=int, help="The PR number")
32+
parser.add_argument("-o", "--org", default="zephyrproject-rtos", help="Github organization")
33+
parser.add_argument("-r", "--repo", default="zephyr", help="Github repository")
3234

3335
return parser.parse_args(argv)
3436

@@ -63,9 +65,9 @@ def main(argv):
6365
token = os.environ.get('GITHUB_TOKEN', None)
6466
gh = github.Github(token)
6567

66-
print_rate_limit(gh, "zephyrproject-rtos")
68+
print_rate_limit(gh, args.org)
6769

68-
repo = gh.get_repo("zephyrproject-rtos/zephyr")
70+
repo = gh.get_repo(f"{args.org}/{args.repo}")
6971
pr = repo.get_pull(args.pull_request)
7072

7173
workflow_delay(repo, pr)

0 commit comments

Comments
 (0)