Skip to content

Commit

Permalink
Merge pull request #413 from balena-os/kyle/check-tests
Browse files Browse the repository at this point in the history
Improve checking of previous test results
  • Loading branch information
klutchell authored Sep 19, 2024
2 parents 659a7eb + 8d17204 commit 9dba7f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/yocto-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ jobs:
# There will be "pull_request" and "pull_request_trigger" triggered workflow runs in the response - one will be skipped, one will be success/fail
# So selecting for .conclusion==success will give us a response and evaluate to true in the following "if" statement if either we successful
passed="false"
if gh api -H "Accept: application/vnd.github+json" /repos/$REPO/actions/runs --jq '.workflow_runs[] | select(.head_sha == "'"${head}"'") | select(.name == "'"${WORKFLOW_NAME}"'") | select(.conclusion == "success")'; then
conclusion="$(gh run list -w "${WORKFLOW_NAME}" -c "${head}" --json conclusion --jq '.[] | select(.conclusion == "success").conclusion')"
if [[ "${conclusion}" = "success" ]]; then
passed="true"
fi
echo "finalize=${passed}" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -532,7 +533,7 @@ jobs:
# Separate this evaluation into its own step + output, as we use this logic in several places and its easier to manage this way
- name: Evaluate whether to finalize release
if: steps.merge-test-result.outputs.finalize || inputs.force-finalize
if: steps.merge-test-result.outputs.finalize == 'true' || inputs.force-finalize
id: should-finalize
run: |
echo "finalize=true" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 9dba7f5

Please sign in to comment.