Skip to content

Commit 3204d58

Browse files
committed
feat(ci): add pr-assigner.yml workflow which uses CODEOWNERS instead of configuration
Related issue: Netcracker/qubership-workflow-hub#458
1 parent e2e251b commit 3204d58

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/pr-assigner.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
contents: read
11+
12+
jobs:
13+
pr-auto-assign:
14+
name: "Auto-assign Reviewers to PR #${{ github.event.pull_request.number }}"
15+
runs-on: ubuntu-latest
16+
permissions:
17+
pull-requests: write
18+
contents: read
19+
steps:
20+
- name: "Check if PR is from a fork"
21+
run: |
22+
if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.event.pull_request.base.repo.full_name }}" ]; then
23+
echo "⚠️ Pull request is from a fork — skipping assignee assignment (no write permissions)."
24+
exit 0
25+
fi
26+
27+
- name: "Checkout Repository"
28+
uses: actions/checkout@v5
29+
with:
30+
persist-credentials: false
31+
32+
- name: "Assign Reviewers"
33+
uses: netcracker/qubership-workflow-hub/actions/pr-assigner@b575bad3a0959c4e883bc34f9d055ff07fde2dbd #2.0.1
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)