Skip to content

Commit 6110d98

Browse files
committed
ci: assigner: do not check permission/manifest on branches
Workaround GH running workflows from main on release branches. The assignment script fails and does wrong assignments based on wrong versions of the maintainer file and manifest. Signed-off-by: Anas Nashif <[email protected]>
1 parent e09d0ad commit 6110d98

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/assigner.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
- name: Fetch west.yml/Maintainer.yml from pull request
4040
if: >
41-
github.event_name == 'pull_request_target'
41+
github.event_name == 'pull_request_target' && github.base_ref == 'main'
4242
run: |
4343
git fetch origin pull/${{ github.event.pull_request.number }}/merge
4444
git show FETCH_HEAD:west.yml > pr_west.yml
@@ -61,7 +61,11 @@ jobs:
6161
FLAGS+=" -r ${{ github.event.repository.name }}"
6262
FLAGS+=" -M MAINTAINERS.yml"
6363
if [ "${{ github.event_name }}" = "pull_request_target" ]; then
64-
FLAGS+=" -P ${{ github.event.pull_request.number }} --updated-manifest pr_west.yml --updated-maintainer-file pr_MAINTAINERS.yml"
64+
if [ "${{ github.base_ref }}" != "main" ]; then
65+
FLAGS+=" -P ${{ github.event.pull_request.number }} --updated-manifest pr_west.yml --updated-maintainer-file pr_MAINTAINERS.yml"
66+
else
67+
FLAGS+=" -P ${{ github.event.pull_request.number }}
68+
fi
6569
elif [ "${{ github.event_name }}" = "issues" ]; then
6670
FLAGS+=" -I ${{ github.event.issue.number }}"
6771
elif [ "${{ github.event_name }}" = "schedule" ]; then
@@ -74,7 +78,7 @@ jobs:
7478
7579
- name: Check maintainer file changes
7680
if: >
77-
github.event_name == 'pull_request_target'
81+
github.event_name == 'pull_request_target' && github.base_ref == 'main'
7882
env:
7983
GITHUB_TOKEN: ${{ secrets.ZB_PR_ASSIGNER_GITHUB_TOKEN }}
8084
run: |

0 commit comments

Comments
 (0)