Skip to content

Commit

Permalink
chore: add flow for triaging external PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
kanej committed Feb 12, 2024
1 parent 03db253 commit 528afa1
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/autoassign-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PR autoassignment

on:
pull_request:
types: [opened]

jobs:
assign-new-issue:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/github-script@v6
with:
script: |
const externalPrTriager = "kanej";
// Within the Github API PRs are issue objects
const pr = await github.rest.issues.get({
owner: context.issue.owner,
repo: context.issue.repo,
issue_number: context.issue.number
});
const isCollaborator = ["OWNER", "MEMBER", "COLLABORATOR"].includes(pr.data.author_association)
if (isCollaborator) {
return
}
await github.rest.issues.addAssignees({
owner: context.issue.owner,
repo: context.issue.repo,
issue_number: context.issue.number,
assignees: [externalPrTriager],
});

0 comments on commit 528afa1

Please sign in to comment.