2021-11-07 22:52:53 -05:00
|
|
|
name: 'Triage Issues'
|
2021-11-07 15:24:27 -05:00
|
|
|
|
|
|
|
on:
|
|
|
|
issues:
|
|
|
|
types: [opened]
|
|
|
|
|
|
|
|
jobs:
|
2021-11-07 22:52:53 -05:00
|
|
|
Triage-New-Issue:
|
2021-11-07 15:24:27 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@v2
|
2021-11-07 22:52:53 -05:00
|
|
|
- name: Verify that issue contains valid authors
|
|
|
|
id: valid-authors
|
2021-11-07 23:04:49 -05:00
|
|
|
if: contains(github.event.issue.labels.*.name, 'type:bug-suspected')
|
2021-11-07 22:52:53 -05:00
|
|
|
uses: ./.github/actions/verify-author
|
|
|
|
with:
|
|
|
|
issue: "${{ toJson(github.event.issue) }}"
|
|
|
|
- name: Add label if missing author
|
|
|
|
uses: actions-ecosystem/action-add-labels@v1
|
|
|
|
if: contains(github.event.issue.labels.*.name, 'type:bug-suspected') && steps.valid-authors.outputs.valid-authors == ''
|
|
|
|
with:
|
|
|
|
labels: status:wrong-author
|
|
|
|
- name: Notify when invalid authors
|
|
|
|
if: contains(github.event.issue.labels.*.name, 'type:bug-suspected') && steps.valid-authors.outputs.valid-authors == ''
|
|
|
|
uses: actions/github-script@0.8.0
|
|
|
|
with:
|
|
|
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
script: |
|
|
|
|
const fs = require('fs')
|
|
|
|
const issueBody = fs.readFileSync(".github/ISSUE_RESPONSES/wrong-author.md", "utf8")
|
|
|
|
github.issues.createComment({
|
|
|
|
issue_number: context.issue.number,
|
|
|
|
owner: context.repo.owner,
|
|
|
|
repo: context.repo.repo,
|
|
|
|
body: issueBody
|
|
|
|
})
|
2021-11-07 15:24:27 -05:00
|
|
|
- name: Add issue to project board
|
2021-11-07 23:04:49 -05:00
|
|
|
if: contains(github.event.issue.labels.*.name, 'type:bug-suspected')
|
2021-11-07 15:24:27 -05:00
|
|
|
uses: actions/github-script@0.8.0
|
|
|
|
with:
|
|
|
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
script: |
|
|
|
|
github.projects.createCard({
|
2021-11-07 23:21:53 -05:00
|
|
|
column_id: 16754671,
|
2021-11-07 15:24:27 -05:00
|
|
|
content_id: context.payload.issue.id,
|
|
|
|
content_type: "Issue"
|
2021-11-07 23:21:53 -05:00
|
|
|
});
|