Skip to content

chore(deps): bump actions/stale from 9 to 11 #5

chore(deps): bump actions/stale from 9 to 11

chore(deps): bump actions/stale from 9 to 11 #5

Workflow file for this run

name: PR auto-assign

Check warning on line 1 in .github/workflows/pr-auto-assign.yml

View workflow run for this annotation

GitHub Actions / PR auto-assign

Workflow execution policy warning (evaluate mode)

On November 2, 2026, GitHub will restrict `pull_request_target` on public repositories by default. To continue allowing the event trigger, configure an Actions policy. Learn more: https://gh.io/securely-using-pull_request_target#default-policy-for-pull_request_target
# Assigns the PR author (optional) and requests review from the maintainers team
# when a pull request is opened or reopened.
on:
pull_request_target:
types: [opened, reopened, ready_for_review]
permissions:
pull-requests: write
contents: read
jobs:
auto-assign:
name: Assign & request reviewers
runs-on: ubuntu-latest
# Skip Dependabot / bots and draft PRs for review requests still allowed on ready_for_review
if: ${{ github.event.pull_request.user.type != 'Bot' }}
steps:
- name: Assign PR author
uses: actions/github-script@v7
with:
script: |
const pr = context.payload.pull_request;
const author = pr.user.login;
// Optional: assign the author so they stay on the PR (skipped if already assigned)
const assignees = (pr.assignees || []).map(a => a.login);
if (!assignees.includes(author)) {
await github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
assignees: [author],
});
core.info(`Assigned author: ${author}`);
} else {
core.info(`Author already assigned: ${author}`);
}
- name: Request maintainers review
if: ${{ github.event.pull_request.draft == false }}
uses: actions/github-script@v7
with:
script: |
const pr = context.payload.pull_request;
const team_slug = 'maintainers';
try {
await github.rest.pulls.requestReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr.number,
team_reviewers: [team_slug],
});
core.info(`Requested review from @${context.repo.owner}/${team_slug}`);
} catch (err) {
// Common on forks / missing team permissions — do not fail the workflow hard
core.warning(`Could not request team reviewers: ${err.message}`);
}