From 77ef3f74d8f8984c9ff0b9fbbfa8c6c765b336d5 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Wed, 18 Jun 2025 07:44:39 +0800 Subject: [PATCH] github: add workflow action --- .github/workflows/lock.yml | 31 +++++++++++++++++++++++++++++++ .github/workflows/stale.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 .github/workflows/lock.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml new file mode 100644 index 0000000..ad1080a --- /dev/null +++ b/.github/workflows/lock.yml @@ -0,0 +1,31 @@ +name: Lock Threads + +on: + schedule: + - cron: "30 12 * * *" + workflow_dispatch: + +concurrency: + group: lock + +jobs: + lock: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + discussions: write + steps: + - uses: dessant/lock-threads@v5 + with: + issue-inactive-days: "30" + issue-comment: > + I'm going to lock this issue because it has been closed for _30 days_. ⏳ + + This helps our maintainers find and focus on the active issues. + If you have found a problem that seems similar to this, please file a new + issue and complete the issue template so we can capture all the details + necessary to investigate further. + pr-inactive-days: "30" + discussion-inactive-days: "30" + process-only: "issues,prs,discussions" diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..37d6c59 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,26 @@ +name: Close manually marked stale issues +on: + schedule: + - cron: "30 12 * * *" # 每天 UTC 12:30 运行 + +jobs: + close-issues: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/stale@v9 + with: + # 禁用自动标记 stale(仅手动标记的 issue 会被处理) + days-before-issue-stale: -1 + # 手动标记后,14 天后关闭 + days-before-issue-close: 14 + # 使用的标签(必须和你手动添加的标签一致) + stale-issue-label: "stale" + # 关闭时的提示信息 + close-issue-message: "This issue was closed because it was marked as stale and had no activity for 14 days." + # 禁用 PR 处理 + days-before-pr-stale: -1 + days-before-pr-close: -1 + repo-token: ${{ secrets.GITHUB_TOKEN }}