^apt-repository

+actions-cleanup
This commit is contained in:
Raul Dipeas 2022-06-18 22:48:25 -03:00
parent 2290ac5320
commit 3c4f26c1f7
2 changed files with 10 additions and 0 deletions

View file

@ -14,8 +14,10 @@ jobs:
run: |
bash -x env.sh
bash -x build.sh
bash -x actions-cleanup.sh
env:
GEMFURY_PUSH_TOKEN: ${{ secrets.GEMFURY_PUSH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Send mail
if: always()
uses: dawidd6/action-send-mail@v2

8
actions-cleanup.sh Normal file
View file

@ -0,0 +1,8 @@
#!/bin/bash
set -e
PROJECT='rauldipeas/apt-repository'
KEEP=1
gh api\
repos/$PROJECT/actions/runs\
--paginate -q '.workflow_runs[]|select(.head_branch != "any")|"\(.id)"'|tail -n+$((KEEP+1))\
|xargs -n1 -I % gh api repos/$PROJECT/actions/runs/% -X DELETE