diff --git a/.github/workflows/cleanup-skipped-runs.yml b/.github/workflows/cleanup-skipped-runs.yml new file mode 100644 index 0000000..97db529 --- /dev/null +++ b/.github/workflows/cleanup-skipped-runs.yml @@ -0,0 +1,20 @@ +name: Cleanup Skipped Runs + +on: + schedule: + - cron: '0 0 * * 0' # 毎週日曜 UTC 0:00 + workflow_dispatch: # 手動実行も可能 + +jobs: + cleanup: + runs-on: ubuntu-latest + permissions: + actions: write + steps: + - name: Delete skipped TAKT Action runs + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + run: | + gh run list --workflow=takt-action.yml --status=skipped --limit=100 --json databaseId --jq '.[].databaseId' | \ + xargs -I {} gh run delete {}