From d8a0aaad6de3403392340b1738d0dccd72313d1c Mon Sep 17 00:00:00 2001 From: zbf Date: Mon, 6 Feb 2023 10:48:00 +0800 Subject: [PATCH] ci: auto close inactive issues --- .github/workflows/close-inactive-issues.yml | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/close-inactive-issues.yml diff --git a/.github/workflows/close-inactive-issues.yml b/.github/workflows/close-inactive-issues.yml new file mode 100644 index 00000000..b2eaa24f --- /dev/null +++ b/.github/workflows/close-inactive-issues.yml @@ -0,0 +1,22 @@ +name: Close Inactive Issues +on: + schedule: + - cron: '0 6 * * *' # 每天早上6点运行,github的cron表达式规则和其他的不太一致 + +jobs: + close-issues: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/stale@v5 + with: + days-before-issue-stale: 14 # 14天无操作标记不活跃 + days-before-issue-close: 14 # 再过14天不活跃关闭 + stale-issue-label: 'stale' + stale-issue-message: 'This issue is stale because it has been open for 7 days with no activity.' + close-issue-message: 'This issue was closed because it has been inactive for 7 days since being marked as stale.' + days-before-pr-stale: -1 + days-before-pr-close: -1 + repo-token: ${{ secrets.WORKFLOW_TOKEN }} # 勾选workflow列