Files
AnyPS5/.github/workflows/stale-conflicts.yml
T
GalaxyGamingFRandClaude Opus 5.5 8e498e3f76 fix(ci): clear the stale label once a PR is rebased
Stale conflicts runs actions/stale with only-pr-labels: needs rebase.
actions/stale skips any PR without all only-labels before it looks at
remove-pr-stale-when-updated, so after a rebase removes needs rebase the
PR is never processed again and keeps its stale label for good. A step
before actions/stale now removes stale from open PRs that no longer
carry needs rebase.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zyXkUzTZGh3nBwNMtrLaW
2026-10-14 00:55:49 -07:00

37 lines
1.2 KiB
YAML

name: Stale conflicts
on:
schedule:
- cron: '30 3 * * *'
workflow_dispatch:
permissions: {}
jobs:
warn:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr list -R "$GITHUB_REPOSITORY" --label stale -L 1000 --json number,labels \
--jq '.[] | select(all(.labels[]; .name != "needs rebase")) | .number' |
while read -r number; do
gh api -X DELETE "repos/$GITHUB_REPOSITORY/issues/$number/labels/stale" --silent
done
- uses: actions/stale@v11
with:
only-pr-labels: needs rebase
days-before-issue-stale: -1
days-before-issue-close: -1
days-before-pr-stale: 7
days-before-pr-close: -1
stale-pr-label: stale
stale-pr-message: 'This pull request has conflicted with `main` and had no activity for 7 days. Rebase it on current `main` so it can be reviewed and merged. It will not be closed automatically.'
remove-pr-stale-when-updated: true
exempt-draft-pr: true
operations-per-run: 200