Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,29 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Get the workflow runs for the build-tests workflow on this tag
# Get the workflow runs for the build-tests workflow on this commit SHA
TAG_NAME="${{ steps.get_tag.outputs.TAG_NAME }}"
COMMIT_SHA="${{ github.sha }}"

echo "Looking for build workflow runs for commit: $COMMIT_SHA"

WORKFLOW_RUNS=$(curl -s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${{ github.repository }}/actions/workflows/build-tests.yml/runs?event=push&status=success&head_branch=$TAG_NAME")
"https://api.github.com/repos/${{ github.repository }}/actions/workflows/build-tests.yml/runs?event=push&status=success&head_sha=$COMMIT_SHA")

# Get the most recent successful run ID
# Get the most recent successful run ID for this exact commit
RUN_ID=$(echo "$WORKFLOW_RUNS" | jq -r '.workflow_runs[0].id // empty')

if [ -z "$RUN_ID" ]; then
echo "Error: No successful build workflow run found for tag $TAG_NAME"
echo "Error: No successful build workflow run found for commit $COMMIT_SHA (tag $TAG_NAME)"
echo "Available workflow runs:"
echo "$WORKFLOW_RUNS" | jq -r '.workflow_runs[] | "ID: \(.id), SHA: \(.head_sha), Status: \(.status), Event: \(.event)"'
exit 1
fi

echo "Found build workflow run: $RUN_ID"
echo "Found build workflow run: $RUN_ID for commit: $COMMIT_SHA"
echo "RUN_ID=$RUN_ID" >> $GITHUB_OUTPUT

- name: Download build artifacts
Expand Down
Loading