diff --git a/.github/workflows/pr-assigner.yml b/.github/workflows/pr-assigner.yml new file mode 100644 index 0000000..66965ff --- /dev/null +++ b/.github/workflows/pr-assigner.yml @@ -0,0 +1,31 @@ +name: PR Auto-Assignment +run-name: "Assigning reviewers for PR #${{ github.event.pull_request.number }}" +on: + pull_request_target: + types: [opened, reopened, synchronize] + branches: + - main + +permissions: + pull-requests: write + contents: read + +jobs: + pr-auto-assign: + runs-on: ubuntu-latest + + steps: + - name: Check if PR is from a fork + run: | + if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.event.pull_request.base.repo.full_name }}" ]; then + echo "⚠️ Pull request is from a fork — skipping assignee assignment (no write permissions)." + exit 0 + fi + + - uses: actions/checkout@v5 + with: + persist-credentials: false + + - uses: netcracker/qubership-workflow-hub/actions/pr-assigner@b575bad3a0959c4e883bc34f9d055ff07fde2dbd #2.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}