Skip to content
This repository was archived by the owner on Dec 22, 2024. It is now read-only.

Commit 5fb5f68

Browse files
committed
fix clear workflow runs ci
1 parent 955a8a7 commit 5fb5f68

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

.github/workflows/auto-builder.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
- name: Get New Package Versions From Image
6262
run: |
6363
docker run --rm --entrypoint /bin/sh -v ${PWD}:/tmp vcxpz/ci-build:ci-build -c '\
64-
wget -q -O - https://raw.githubusercontent.com/hydazz/docker-utils/main/docker/package_versioner.sh | bash'
64+
wget -q -O - https://raw.githubusercontent.com/hydazz/docker-utils/main/scripts/package_versioner.sh | bash'
6565
6666
- name: Commit and Push Changes to Github
6767
run: |

.github/workflows/clear-workflow-runs.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,17 @@ jobs:
1414
- uses: actions/checkout@v2
1515

1616
- name: Clear all workflow runs
17-
uses: Mattraks/delete-workflow-runs@main
18-
with:
19-
token: ${{ secrets.TOKEN }}
20-
repository: ${{ github.repository }}
21-
retain_days: 1
17+
env:
18+
TOKEN: ${{ secrets.TOKEN }}
19+
run: |
20+
echo "${TOKEN}" | gh auth login --with-token
21+
runs=$(gh api repos/hydazz/docker-amp/actions/runs | jq -r .total_count)
22+
while true; do
23+
if [[ $(gh api repos/hydazz/docker-amp/actions/runs | jq -r .total_count) -gt 2 ]]; then
24+
gh api repos/hydazz/docker-amp/actions/runs \
25+
--paginate -q '.workflow_runs[] | "\(.id)"' | \
26+
xargs -n1 -I % gh api repos/hydazz/docker-amp/actions/runs/% -X DELETE || true
27+
else
28+
exit 0
29+
fi
30+
done

0 commit comments

Comments
 (0)