Improve the interceptor action

Avoid secondary runs
This commit is contained in:
Cotes Chung 2020-11-30 21:56:15 +08:00
parent 20c14c0207
commit 6a326dc8e0

View file

@ -1,16 +1,20 @@
name: "Intercept bad issue/PRs" name: "Intercept bad issue/PRs"
on: [issues, pull_request] on:
issues:
types: opened
pull_request:
types: opened
jobs: jobs:
autoclose: autoclose:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: 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 uses: roots/issue-closer@v1.1
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-pattern: "\\[x\\] I have read" 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-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."