Skip to content

Code Enhancements and Fixes for Hardhat #641

Code Enhancements and Fixes for Hardhat

Code Enhancements and Fixes for Hardhat #641

name: PR autoassignment
on:
pull_request_target:
types: [opened]
jobs:
assign-new-issue:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/github-script@v7
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],
});