2022-11-08 19:18:12 +08:00
|
|
|
name: Stale Workflow Queue Cleanup
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2023-01-03 19:41:39 +08:00
|
|
|
branches: [main]
|
2022-11-08 19:18:12 +08:00
|
|
|
schedule:
|
2023-01-03 20:38:35 +08:00
|
|
|
# everyday at 15:00
|
2022-11-08 19:18:12 +08:00
|
|
|
- cron: '0 15 * * *'
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: stale-workflow-queue-cleanup
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
cleanup:
|
|
|
|
name: Cleanup
|
2023-03-18 18:11:12 +08:00
|
|
|
runs-on: ubuntu-22.04
|
2022-11-08 19:18:12 +08:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Delete stale queued workflow runs
|
|
|
|
uses: MajorScruffy/delete-old-workflow-runs@v0.3.0
|
|
|
|
with:
|
|
|
|
repository: ${{ github.repository }}
|
|
|
|
# Remove any workflow runs in "queued" state for more than 1 day
|
|
|
|
older-than-seconds: 86400
|
|
|
|
status: queued
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|