标记长期未活跃的 Issue #30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 本工作流用于标记并关闭长期不活跃的 Issue。 | |
| # 文档: https://github.com/actions/stale | |
| name: 标记长期未活跃的 Issue | |
| on: | |
| schedule: | |
| # 每天 UTC 00:30 执行 (北京时间 08:30) | |
| - cron: '30 0 * * *' | |
| workflow_dispatch: | |
| inputs: | |
| dry-run: | |
| description: '仅预览, 不实际执行 (Dry run mode)' | |
| required: false | |
| default: true | |
| type: boolean | |
| jobs: | |
| stale: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - name: 检出代码 | |
| uses: actions/checkout@v4 | |
| - name: 确保标签颜色正确 | |
| # 仅在非 dry-run 模式下执行,避免预览时报错或产生副作用 | |
| if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }} | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh label create "status/stale" --color "EDEDED" --description "长期无活动的 Issue" || gh label edit "status/stale" --color "EDEDED" --description "长期无活动的 Issue" | |
| - uses: actions/stale@v10 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| operations-per-run: 200 | |
| any-of-labels: 'type/fix,bug' | |
| # 不处理 PR | |
| days-before-pr-stale: -1 | |
| days-before-pr-close: -1 | |
| # 不活跃判定与关闭策略: 先标记 stale, 再延迟关闭 | |
| days-before-issue-stale: 60 | |
| days-before-issue-close: 30 | |
| stale-issue-label: 'status/stale' | |
| stale-issue-message: | | |
| 该 Issue 因较长时间无活动,已被标记为 `status/stale`。 | |
| 如无后续活动,将在一段时间后自动关闭。 | |
| 如仍需跟进,请回复评论。 | |
| --- | |
| This issue has been automatically marked as **status/stale** because it has not had any activity. | |
| It will be closed in a certain period of time if no further activity occurs. | |
| If this issue is still relevant, please leave a comment. | |
| --- | |
| この問題は長い間活動がないため、自動的に **status/stale** としてマークされました。 | |
| 今後活動がない場合、一定期間後に閉鎖されます。 | |
| まだ関連性がある場合は、コメントを残してください。 | |
| close-issue-message: | | |
| 该 Issue 因长期无活动已自动关闭。 | |
| 如问题仍存在,欢迎补充复现信息并重新打开或新建 Issue。 | |
| --- | |
| This issue has been automatically closed due to inactivity. | |
| If the problem still exists, feel free to reopen or create a new issue with updated information. | |
| --- | |
| この問題は長期にわたって活動がないため、自動的に閉鎖されました。 | |
| 問題がまだ存在する場合は、再現情報を追加して再開するか、新しい問題を作成してください。 | |
| remove-stale-when-updated: true | |
| debug-only: ${{ github.event_name == 'workflow_dispatch' && inputs.dry-run }} |