From 5fab7dc5727256a8576fbf5ad65415428e069e40 Mon Sep 17 00:00:00 2001 From: Hugo Bernier Date: Sun, 7 Nov 2021 22:52:53 -0500 Subject: [PATCH] Update triage-issues.yml --- .github/workflows/triage-issues.yml | 48 +++++++++++++++++------------ 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/.github/workflows/triage-issues.yml b/.github/workflows/triage-issues.yml index 5fb32b777..0a76831b3 100644 --- a/.github/workflows/triage-issues.yml +++ b/.github/workflows/triage-issues.yml @@ -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" });