diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25ca2fd..eb60acf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,29 +114,28 @@ jobs: GH_TOKEN: ${{ secrets.TESTING_PUSH_TOKEN }} run: make reset-history - - name: Wait success of generated project's workflow + - name: Wait for success of generated project's workflow env: GH_TOKEN: ${{ github.token }} run: | cd tests/tmp || exit 1 while true; do - echo "Waiting 5 seconds..." - sleep 5 - echo "Fetching CI workflow..." - if ! output=$(gh run list --repo pawamoy/pawamoy-testing --branch 0.1.0 --limit 1 --workflow "ci.yml" --json status,conclusion); then - continue - fi - status=$(jq -r ".[0].status" <<< "$output") - if [ "${status}" = "completed" ]; then - echo "Workflow completed!" - conclusion=$(jq -r ".[0].conclusion" <<< "$output") - echo "Status: ${conclusion}" - [ "${conclusion}" == "success" ] && break || exit 1 + if output=$(gh run list --repo pawamoy/pawamoy-testing --branch 0.1.0 --limit 1 --workflow "ci.yml" --json status,conclusion); then + status=$(jq -r ".[0].status" <<< "$output") + if [ "${status}" = "completed" ]; then + echo "Workflow completed!" + conclusion=$(jq -r ".[0].conclusion" <<< "$output") + echo "Status: ${conclusion}" + [ "${conclusion}" == "success" ] && break || exit 1 + else + echo "Workflow status: ${status}" + fi else - echo "Workflow status: ${status}" + echo "Workflow not found, retrying in 20 seconds" fi + sleep 20 done - echo "Delete all testing releases..." + echo "Deleting all testing releases..." for tag in $(gh release list --repo pawamoy/pawamoy-testing --json tagName --jq ".[].tagName"); do - gh release delete --repo pawamoy/pawamoy-testing --tag "${tag}" --yes --cleanup-tag + gh release delete "${tag}" --repo pawamoy/pawamoy-testing --yes --cleanup-tag done