Skip to content

Commit 6446efd

Browse files
fix(ci): update PR auto-assignment workflow to use pull_request event and improve fork handling (#16)
1 parent 4439dd5 commit 6446efd

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/pr-assigner.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: PR Auto-Assignment
2+
run-name: "Assigning reviewers for PR #${{ github.event.pull_request.number }}"
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened, synchronize]
6+
branches:
7+
- main
8+
9+
permissions:
10+
pull-requests: write
11+
contents: read
12+
13+
jobs:
14+
pr-auto-assign:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Check if PR is from a fork
19+
run: |
20+
if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.event.pull_request.base.repo.full_name }}" ]; then
21+
echo "⚠️ Pull request is from a fork — skipping assignee assignment (no write permissions)."
22+
exit 0
23+
fi
24+
25+
- uses: actions/checkout@v5
26+
with:
27+
persist-credentials: false
28+
29+
- uses: netcracker/qubership-workflow-hub/actions/pr-assigner@b575bad3a0959c4e883bc34f9d055ff07fde2dbd #2.0.1
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)