From aac29d43e52427a55ee082bad89248ea42b3a66e Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Tue, 17 Nov 2020 17:13:22 +0800 Subject: [PATCH] Auto close the irregular issues also fix the token key of issue-cleaner --- .github/workflows/issues-cleaner.yml | 2 +- .github/workflows/issues-filter.yml | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/issues-filter.yml diff --git a/.github/workflows/issues-cleaner.yml b/.github/workflows/issues-cleaner.yml index de4c5c9..55cb9e1 100644 --- a/.github/workflows/issues-cleaner.yml +++ b/.github/workflows/issues-cleaner.yml @@ -12,7 +12,7 @@ jobs: DAYS_TO_CLOSE: ${{ 2 }} uses: actions/stale@v3 with: - repo-token: ${{ secrets.GITHUB_TOKEN }} + repo-token: ${{ secrets.GH_PAT }} stale-issue-message: 'This issue is stale because it has been open ${{ env.DAYS_TO_STALE }} days with no activity. Remove stale label or comment or this will be closed in ${{ env.DAYS_TO_CLOSE }} days' stale-issue-label: 'stale' exempt-issue-labels: 'pending, in progress' diff --git a/.github/workflows/issues-filter.yml b/.github/workflows/issues-filter.yml new file mode 100644 index 0000000..0d2c261 --- /dev/null +++ b/.github/workflows/issues-filter.yml @@ -0,0 +1,18 @@ +name: "Close Irregular Issues" + +on: + issues: + types: [opened, edited] + +jobs: + auto_close_issues: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Automatically close issues that don't follow the issue template + uses: lucasbento/auto-close-issues@v1.0.2 + with: + github-token: ${{ secrets.GH_PAT }} + issue-close-message: "@${issue.user.login}: hello! :wave:\n\nThis issue is being automatically closed because it does not follow the issue template. \n> Follow the template to edit this issue and it will automatically reopen." + closed-issues-label: "🙁 Not following issue template"