From 6a326dc8e0a832d806a50322a82104efbf05870b Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Mon, 30 Nov 2020 21:56:15 +0800 Subject: [PATCH] Improve the interceptor action Avoid secondary runs --- .github/workflows/issue-pr-interceptor.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/issue-pr-interceptor.yml b/.github/workflows/issue-pr-interceptor.yml index 39963c5..ee5349a 100644 --- a/.github/workflows/issue-pr-interceptor.yml +++ b/.github/workflows/issue-pr-interceptor.yml @@ -1,16 +1,20 @@ name: "Intercept bad issue/PRs" -on: [issues, pull_request] +on: + issues: + types: opened + pull_request: + types: opened jobs: autoclose: runs-on: ubuntu-latest steps: - - name: Autoclose issues that did not follow issue template + - name: Auto close issues/pr that did not follow template uses: roots/issue-closer@v1.1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} issue-pattern: "\\[x\\] I have read" - issue-close-message: "Hi @${issue.user.login} :wave:,\n\nThis issue is being automatically closed because it does not follow the issue template." + issue-close-message: ":wave: Hi @${issue.user.login},\n\nThis issue is being automatically closed because it does not follow the issue template." pr-pattern: "\\[x\\] Bug|\\[x\\] New feat|\\[x\\] Break|\\[x\\] Doc" - pr-close-message: "Hi @${pull_request.user.login} :wave:,\n\nThis PR is being automatically closed because it does not follow the PR template." + pr-close-message: ":wave: Hi @${pull_request.user.login},\n\nThis PR is being automatically closed because it does not follow the PR template."