Skip to content

Instantly share code, notes, and snippets.

@jinzhongjia
Created December 6, 2025 06:57
Show Gist options
  • Select an option

  • Save jinzhongjia/c9b0ec5ed45968846f628f18bc3ee347 to your computer and use it in GitHub Desktop.

Select an option

Save jinzhongjia/c9b0ec5ed45968846f628f18bc3ee347 to your computer and use it in GitHub Desktop.
name: Close Stale Pull Requests
on:
schedule:
# 每天 UTC+8 时区凌晨 04:00 运行(UTC 20:00)
- cron: '0 20 * * *'
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v9
with:
# 查找超过 30 天没有活动的 PR
days-before-stale: 30
# 标记为 stale 后,再过 7 天自动关闭
days-before-close: 7
# 标记 stale 时添加的评论
stale-pr-message: '此 Pull Request 已超过 30 天没有活动。它将被标记为 `stale`。如果您认为它仍然相关,请添加评论或推送新的提交。'
# 关闭 PR 时添加的评论
close-pr-message: '此 Pull Request 已超过 7 天处于 `stale` 状态,将被自动关闭。'
# 标记 stale 时添加的标签
stale-pr-label: 'stale'
# 排除带有特定标签的 PR,例如 "pinned" 或 "work in progress"
exempt-pr-labels: 'pinned, work in progress, do not close'
# 排除带有特定里程碑的 PR
exempt-pr-milestones: ''
# 排除带有特定分配者的 PR
exempt-pr-assignees: ''
# 排除特定分支的 PR
exempt-pr-branches: ''
# 仅处理 PR,不处理 issue
only-pr: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment