diff --git a/.github/workflows/template.yml b/.github/workflows/template.yml index 75cc0b6..97bdb95 100644 --- a/.github/workflows/template.yml +++ b/.github/workflows/template.yml @@ -62,6 +62,10 @@ jobs: git commit --amend -m "chore: setup project from template" git push -f origin HEAD - for id in $(gh api "/repos/$GH_REPOSITORY/actions/workflows/main.yml/runs?status=in_progress" | jq -r '.workflow_runs[].id'); do - gh api -XPOST "/repos/$GH_REPOSITORY/actions/runs/$id/cancel" + for i in {1..10}; do + for id in $(gh api "/repos/$GH_REPOSITORY/actions/workflows/main.yml/runs?status=in_progress" | jq -r '.workflow_runs[].id'); do + gh api -XPOST "/repos/$GH_REPOSITORY/actions/runs/$id/cancel" + exit 0 + done + sleep 3 done