name: triage on: pull_request_target: types: - opened issues: types: - opened env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} permissions: contents: read issues: write pull-requests: write jobs: debug-context: runs-on: ubuntu-24.04 steps: - name: View context attributes uses: actions/github-script@v7 with: script: console.log({ context }) label-created-by: name: label-on-open runs-on: ubuntu-24.04 steps: - name: Tag with 'created-by' uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const payloadTeamUsernames = [ 'denolfe', 'jmikrut', 'DanRibbens', 'jacobsfletch', 'JarrodMFlesch', 'AlessioGr', 'JessChowdhury', 'kendelljoseph', 'PatrikKozak', 'tylandavis', 'paulpopus', 'r1tsuu', 'GermanJablo', ]; const type = context.payload.pull_request ? 'pull_request' : 'issue'; const isTeamMember = payloadTeamUsernames .map(n => n.toLowerCase()) .includes(context.payload[type].user.login.toLowerCase()); if (isTeamMember) { github.rest.issues.addLabels({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, labels: ['created-by: Payload team'], }); console.log(`Added 'created-by: Payload team' label`); return; } const association = context.payload[type].author_association; let label = '' if (association === 'MEMBER' || association === 'OWNER') { label = 'created-by: Payload team'; } else if (association === 'CONTRIBUTOR') { label = 'created-by: Contributor'; } if (!label) return; github.rest.issues.addLabels({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, labels: [label], }); console.log(`Added '${label}' label.`); triage: name: initial-triage if: github.event_name == 'issues' runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.base.ref }} token: ${{ secrets.GITHUB_TOKEN }} - uses: ./.github/actions/triage with: reproduction-comment: '.github/comments/invalid-reproduction.md' reproduction-link-section: '### Link to the code that reproduces this issue(.*)### Reproduction Steps' reproduction-issue-labels: 'validate-reproduction' actions-to-perform: 'tag,comment'