diff --git a/.github/workflows/publish_charm.yaml b/.github/workflows/publish_charm.yaml index 521b5e119..888a3e9b5 100644 --- a/.github/workflows/publish_charm.yaml +++ b/.github/workflows/publish_charm.yaml @@ -113,50 +113,50 @@ jobs: if: ${{ github.event_name == 'push' }} shell: bash run: | - # Get commit info - TREE_SHA=$(gh api \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - /repos/${{ github.repository }}/commits/${GITHUB_SHA} \ - --jq '.commit.tree.sha') - # Get workflow run id from this specific tree id, paginate until found - TOTAL_COUNT=$(gh api \ - --method GET \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - /repos/${{ github.repository }}/actions/runs \ - -f status=completed \ - -f event=pull_request | jq ".total_count") - PER_PAGE=100 - MAX_PAGES=$(( (TOTAL_COUNT + 99) / $PER_PAGE )) - PAGE=1 - while true; do - RESULT=$( gh api \ - --method GET \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - /repos/${{ github.repository }}/actions/runs \ - -f page=$PAGE \ - -f per_page=$PER_PAGE \ - -f status=completed \ - -f event=pull_request \ - --jq "[ - .workflow_runs[] - | select(.path == \".github/workflows/integration_test.yaml\") - | select(.head_commit.tree_id == \"$TREE_SHA\") - ] | max_by(.updated_at) | .id" - ) - - if [[ -n $RESULT ]]; then - RUN_ID=$RESULT - break - fi - if [[ "PAGE" -eq "$MAX_PAGES" ]]; then - echo "::error::No workflow run id found for specific tree id" - exit 1 - fi - ((PAGE++)) - done +# # Get commit info +# TREE_SHA=$(gh api \ +# -H "Accept: application/vnd.github+json" \ +# -H "X-GitHub-Api-Version: 2022-11-28" \ +# /repos/${{ github.repository }}/commits/${GITHUB_SHA} \ +# --jq '.commit.tree.sha') +# # Get workflow run id from this specific tree id, paginate until found +# TOTAL_COUNT=$(gh api \ +# --method GET \ +# -H "Accept: application/vnd.github+json" \ +# -H "X-GitHub-Api-Version: 2022-11-28" \ +# /repos/${{ github.repository }}/actions/runs \ +# -f status=completed \ +# -f event=pull_request | jq ".total_count") +# PER_PAGE=100 +# MAX_PAGES=$(( (TOTAL_COUNT + 99) / $PER_PAGE )) +# PAGE=1 +# while true; do +# RESULT=$( gh api \ +# --method GET \ +# -H "Accept: application/vnd.github+json" \ +# -H "X-GitHub-Api-Version: 2022-11-28" \ +# /repos/${{ github.repository }}/actions/runs \ +# -f page=$PAGE \ +# -f per_page=$PER_PAGE \ +# -f status=completed \ +# -f event=pull_request \ +# --jq "[ +# .workflow_runs[] +# | select(.path == \".github/workflows/integration_test.yaml\") +# | select(.head_commit.tree_id == \"$TREE_SHA\") +# ] | max_by(.updated_at) | .id" +# ) +# +# if [[ -n $RESULT ]]; then +# RUN_ID=$RESULT +# break +# fi +# if [[ "PAGE" -eq "$MAX_PAGES" ]]; then +# echo "::error::No workflow run id found for specific tree id" +# exit 1 +# fi +# ((PAGE++)) +# done echo "RUN_ID=8611736651" >> $GITHUB_ENV env: