|
| 1 | +name: Close Stale Unsigned CLA PRs |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + # Runs daily at 01:30 UTC. |
| 6 | + - cron: '30 1 * * *' |
| 7 | + workflow_dispatch: {} |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + pull-requests: write |
| 12 | + issues: write |
| 13 | + |
| 14 | +# Configurable intervals (days). |
| 15 | +# DAYS_BEFORE_WARNING = grace period before the warning comment. |
| 16 | +# DAYS_BEFORE_CLOSURE = further period after the warning before closing. |
| 17 | +env: |
| 18 | + DAYS_BEFORE_WARNING: 7 |
| 19 | + DAYS_BEFORE_CLOSURE: 21 |
| 20 | + |
| 21 | +jobs: |
| 22 | + stale: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + steps: |
| 25 | + - name: Close stale unsigned-CLA PRs |
| 26 | + uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 #v10.3.0 |
| 27 | + with: |
| 28 | + # ---- Guards: only act on PRs carrying the CLA label ---- |
| 29 | + only-labels: 'awaiting cla' |
| 30 | + |
| 31 | + # Never touch issues — PRs only. |
| 32 | + days-before-issue-stale: -1 |
| 33 | + days-before-issue-close: -1 |
| 34 | + |
| 35 | + # ---- Timing ---- |
| 36 | + # DAYS_BEFORE_WARNING: days of inactivity before the warning comment. |
| 37 | + days-before-pr-stale: ${{ env.DAYS_BEFORE_WARNING }} |
| 38 | + # DAYS_BEFORE_CLOSURE: days after being marked stale before closing. |
| 39 | + days-before-pr-close: ${{ env.DAYS_BEFORE_CLOSURE }} |
| 40 | + |
| 41 | + # ---- Warning comment (posted once when marked stale) ---- |
| 42 | + stale-pr-message: > |
| 43 | + As we are unable to accept contributions unless the CLA has |
| 44 | + been signed, this PR will be automatically closed if the CLA |
| 45 | + is not signed within ${{ env.DAYS_BEFORE_CLOSURE }} days. |
| 46 | +
|
| 47 | + # ---- Close comment ---- |
| 48 | + close-pr-message: > |
| 49 | + This PR has been automatically closed as the CLA remains |
| 50 | + unsigned. We will be happy to have it reopened if the CLA |
| 51 | + is signed subsequently. |
| 52 | +
|
| 53 | + # A dedicated marker label so we can track stale state without |
| 54 | + # interfering with the "awaiting cla" label. |
| 55 | + stale-pr-label: 'cla-stale' |
| 56 | + |
| 57 | + # If the PR is updated after being marked stale, remove the marker |
| 58 | + # so the warning-then-close cycle restarts cleanly. |
| 59 | + remove-pr-stale-when-updated: true |
| 60 | + |
| 61 | + # Process enough PRs per run for busy repos. |
| 62 | + operations-per-run: 200 |
0 commit comments