Skip to content

Commit

Permalink
ci: use jq to check the status of dependencies in the report job
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardosm committed Apr 14, 2024
1 parent 80ac1ab commit 3d8facf
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ jobs:
- package-crates
- build-dist-linux
- build-dist-windows
# 'always()' is needed because GitHub treats a skipped job (due to a failed
# dependency) a success.
if: always()
runs-on: ubuntu-20.04
steps:
- name: Report success
if: "!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')"
run: exit 0
- name: Report failure
if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')"
run: exit 1
- name: Report status
env:
NEEDS_JSON: ${{ toJson(needs) }}
# Make sure all dependencies succeeded.
run: jq --exit-status 'all(.result == "success")' <<< "$NEEDS_JSON"

lint-aux:
runs-on: ubuntu-20.04
Expand Down

0 comments on commit 3d8facf

Please sign in to comment.