Update triage-issues.yml

This commit is contained in:
Hugo Bernier 2021-11-07 22:52:53 -05:00 committed by GitHub
parent 4afde5f863
commit 5fab7dc572
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 29 additions and 19 deletions

View File

@ -1,38 +1,48 @@
name: Triage Issues
name: 'Triage Issues'
on:
issues:
types: [opened]
jobs:
comment:
Triage-New-Issue:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
# - name: Comment on new issue
# 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/comment.md", "utf8")
# github.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: issueBody
# })
- name: Verify that issue contains valid authors
id: valid-authors
if: contains(github.event.issue.labels.*.name, 'bug')
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
})
- name: Add issue to project board
if: contains(github.event.issue.labels.*.name, 'type:bug-suspected')
if: contains(github.event.issue.labels.*.name, 'bug')
uses: actions/github-script@0.8.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.projects.createCard({
column_id: 16754671,
column_id: 16754379,
content_id: context.payload.issue.id,
content_type: "Issue"
});