clean older workflows

This commit is contained in:
j-hc 2023-06-28 02:23:28 +03:00
parent a299cb0882
commit 04a187d758
No known key found for this signature in database
GPG Key ID: FCBF5E9C57092AD9

View File

@ -6,6 +6,7 @@ on:
jobs:
check:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout
@ -61,6 +62,12 @@ jobs:
echo "SHOULD_BUILD=0" >> $GITHUB_OUTPUT
fi
- name: Clear older runs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh run list -L400 --json databaseId -q '.[].databaseId' | tail -n+10 | xargs -IID gh api "repos/$(gh repo view --json nameWithOwner -q .nameWithOwner)/actions/runs/ID" -X DELETE || :
outputs:
SHOULD_BUILD: ${{ steps.should_build.outputs.SHOULD_BUILD }}