diff --git a/cleanup.sh b/cleanup.sh index 7eae06c..03bfbf3 100755 --- a/cleanup.sh +++ b/cleanup.sh @@ -18,6 +18,13 @@ do run_ids=( $(run gh api repos/$GH_REPO/actions/workflows/$workflow_id/runs --paginate | jq '.workflow_runs[].id') ) for run_id in "${run_ids[@]}" do + # delete if not the current run + if [ $run_id -eq $GITHUB_RUN_ID ] + then + info "- Skipping current run ID $run_id" + continue + fi + info "- Deleting Run ID $run_id" gh api repos/$GH_REPO/actions/runs/$run_id -X DELETE >/dev/null #run gh run delete $run_id