^apt-repository
+actions-cleanup
This commit is contained in:
parent
2290ac5320
commit
3c4f26c1f7
2
.github/workflows/apt-repository.yml
vendored
2
.github/workflows/apt-repository.yml
vendored
|
@ -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
8
actions-cleanup.sh
Normal 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
|
Loading…
Reference in a new issue