Skip to content

Commit 85a2d69

Browse files
committed
ci: maintainer_check: Check out PR MAINTAINERS file
The commit 31ef45e converted the maintainer check workflow from `pull_request` to `pull_request_target` -- this caused the "checkout" action to check out the base branch instead of the pull request branch and effectively made the workflow compare the mainline MAINTAINERS.yml against itself. This commit reworks the workflow such that it checks out the pull request MAINTAINERS.yml separately and compare it against the mainline MAINTAINERS.yml checked out by the "checkout" action. Note that the `requirements-actions.txt` and `check_maintainer_changes.py` files used in this workflow are checked out from the base branch (i.e. does not contain any modifications) and therefore do not pose a security risk. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent c7e6034 commit 85a2d69

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/maintainer_check.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ jobs:
3030
run: |
3131
pip install -r scripts/requirements-actions.txt --require-hashes
3232
33-
- name: Fetch MAINTAINERS.yml from mainline
33+
- name: Fetch MAINTAINERS.yml from pull request
3434
run: |
35-
git fetch origin main
36-
git show origin/main:MAINTAINERS.yml > mainline_MAINTAINERS.yml
35+
git fetch origin pull/${{ github.event.pull_request.number }}/head
36+
git show FETCH_HEAD:MAINTAINERS.yml > pr_MAINTAINERS.yml
3737
3838
- name: Check maintainer file changes
3939
env:
4040
GITHUB_TOKEN: ${{ secrets.ZB_PR_ASSIGNER_GITHUB_TOKEN }}
4141
run: |
4242
python ./scripts/ci/check_maintainer_changes.py \
43-
--repo zephyrproject-rtos/zephyr mainline_MAINTAINERS.yml MAINTAINERS.yml
43+
--repo zephyrproject-rtos/zephyr MAINTAINERS.yml pr_MAINTAINERS.yml

0 commit comments

Comments
 (0)