| 1 | name: Sweep stale version reports |
| 2 | |
| 3 | # Reports filed many minors back cannot be confirmed against a current build, |
| 4 | # and 65% of the open tracker has never had a reply. This asks, waits, then |
| 5 | # closes — never closing anything that was not asked first. |
| 6 | |
| 7 | on: |
| 8 | workflow_dispatch: |
| 9 | inputs: |
| 10 | dry_run: |
| 11 | description: Print what would happen without commenting |
| 12 | required: false |
| 13 | default: true |
| 14 | type: boolean |
| 15 | limit: |
| 16 | description: Maximum issues to touch in this run |
| 17 | required: false |
| 18 | default: '40' |
| 19 | type: string |
| 20 | schedule: |
| 21 | - cron: '17 3 * * 1' |
| 22 | push: |
| 23 | branches: |
| 24 | - main-v2 |
| 25 | paths: |
| 26 | - '.github/workflows/stale-report-sweep.yml' |
| 27 | - 'scripts/stale-report-sweep.mjs' |
| 28 | - 'scripts/stale-report-sweep.test.mjs' |
| 29 | |
| 30 | permissions: |
| 31 | contents: read |
| 32 | issues: write |
| 33 | |
| 34 | concurrency: |
| 35 | group: stale-report-sweep |
| 36 | cancel-in-progress: false |
| 37 | |
| 38 | jobs: |
| 39 | sweep: |
| 40 | if: github.repository == 'esengine/DeepSeek-Reasonix' |
| 41 | runs-on: ubuntu-latest |
| 42 | steps: |
| 43 | - uses: actions/checkout@v7 |
| 44 | with: |
| 45 | fetch-depth: 0 |
| 46 | - uses: actions/setup-node@v7 |
| 47 | with: |
| 48 | node-version: '22' |
| 49 | - name: Test sweeper |
| 50 | run: node --test scripts/stale-report-sweep.test.mjs |
| 51 | # A push that only touched the sweeper runs its tests and stops there. |
| 52 | - name: Sweep |
| 53 | if: github.event_name != 'push' |
| 54 | env: |
| 55 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 56 | LIMIT: ${{ github.event.inputs.limit || '40' }} |
| 57 | # Posting stays off until this repository variable is set to "true", so |
| 58 | # merging the sweeper cannot start commenting on its own. |
| 59 | ENABLED: ${{ vars.STALE_SWEEP_ENABLED }} |
| 60 | REQUESTED_DRY_RUN: ${{ github.event.inputs.dry_run || 'true' }} |
| 61 | run: | |
| 62 | set -euo pipefail |
| 63 | args=(--limit "$LIMIT") |
| 64 | if [ "$ENABLED" != "true" ] || [ "$REQUESTED_DRY_RUN" = "true" ]; then |
| 65 | args+=(--dry-run) |
| 66 | echo "::notice::dry run (STALE_SWEEP_ENABLED=${ENABLED:-unset})" |
| 67 | fi |
| 68 | node scripts/stale-report-sweep.mjs "${args[@]}" |
| 69 |