From babcd19bf1d5134044633c8cf286f4cadfdbaef1 Mon Sep 17 00:00:00 2001 From: John Kane Date: Mon, 12 Feb 2024 10:13:01 +0000 Subject: [PATCH 1/2] chore: swap kanej for franco on issue assignment The passing of the baton. --- .github/workflows/autoassign-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autoassign-issues.yml b/.github/workflows/autoassign-issues.yml index f30c14b307..efd4be5620 100644 --- a/.github/workflows/autoassign-issues.yml +++ b/.github/workflows/autoassign-issues.yml @@ -15,7 +15,7 @@ jobs: script: | // each user has a chance of (p - (previousP ?? 0)) to be assigned const potentialAssignees = [ - ["fvictorio", 1/3], + ["kanej", 1/3], ["schaable", 2/3], ["ChristopherDedominici", 1.0], ]; From 2b7b9e5a64e9891bd92d5879a318e44dd15ffd1a Mon Sep 17 00:00:00 2001 From: John Kane Date: Mon, 12 Feb 2024 10:27:08 +0000 Subject: [PATCH 2/2] chore: add flow for triaging external PRs --- .github/workflows/autoassign-prs.yml | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/autoassign-prs.yml diff --git a/.github/workflows/autoassign-prs.yml b/.github/workflows/autoassign-prs.yml new file mode 100644 index 0000000000..0da954d132 --- /dev/null +++ b/.github/workflows/autoassign-prs.yml @@ -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], + });