1name: Stale Workflow Queue Cleanup
2
3on:
4  workflow_dispatch:
5    branches: [main]
6  schedule:
7  # everyday at 15:00
8  - cron: '0 15 * * *'
9
10concurrency:
11  group: stale-workflow-queue-cleanup
12  cancel-in-progress: true
13
14jobs:
15  cleanup:
16    name: Cleanup
17    runs-on: ubuntu-22.04
18
19    steps:
20    - name: Delete stale queued workflow runs
21      uses: MajorScruffy/delete-old-workflow-runs@v0.3.0
22      with:
23        repository: ${{ github.repository }}
24        # Remove any workflow runs in "queued" state for more than 1 day
25        older-than-seconds: 86400
26        status: queued
27      env:
28        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29