mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 07:46:12 +03:00
ci: avoid "successful failure" of status check job by inspecting needs (#4918)
Thanks to @ryanec for this tip.
This commit is contained in:
20
.github/workflows/nix.yml
vendored
20
.github/workflows/nix.yml
vendored
@ -7,8 +7,24 @@ jobs:
|
||||
needs:
|
||||
- check-zig-cache-hash
|
||||
steps:
|
||||
- name: Noop
|
||||
run: echo "Required Checks Met"
|
||||
- id: status
|
||||
name: Determine status
|
||||
run: |
|
||||
results=$(tr -d '\n' <<< '${{ toJSON(needs.*.result) }}')
|
||||
if ! grep -q -v -E '(failure|cancelled)' <<< "$results"; then
|
||||
result="failed"
|
||||
else
|
||||
result="success"
|
||||
fi
|
||||
{
|
||||
echo "result=${result}"
|
||||
echo "results=${results}"
|
||||
} | tee -a "$GITHUB_OUTPUT"
|
||||
- if: always() && steps.status.outputs.result != 'success'
|
||||
name: Check for failed status
|
||||
run: |
|
||||
echo "One or more required build workflows failed: ${{ steps.status.outputs.results }}"
|
||||
exit 1
|
||||
|
||||
check-zig-cache-hash:
|
||||
if: github.repository == 'ghostty-org/ghostty'
|
||||
|
20
.github/workflows/test.yml
vendored
20
.github/workflows/test.yml
vendored
@ -26,8 +26,24 @@ jobs:
|
||||
- typos
|
||||
- test-pkg-linux
|
||||
steps:
|
||||
- name: Noop
|
||||
run: echo "Required Checks Met"
|
||||
- id: status
|
||||
name: Determine status
|
||||
run: |
|
||||
results=$(tr -d '\n' <<< '${{ toJSON(needs.*.result) }}')
|
||||
if ! grep -q -v -E '(failure|cancelled)' <<< "$results"; then
|
||||
result="failed"
|
||||
else
|
||||
result="success"
|
||||
fi
|
||||
{
|
||||
echo "result=${result}"
|
||||
echo "results=${results}"
|
||||
} | tee -a "$GITHUB_OUTPUT"
|
||||
- if: always() && steps.status.outputs.result != 'success'
|
||||
name: Check for failed status
|
||||
run: |
|
||||
echo "One or more required build workflows failed: ${{ steps.status.outputs.results }}"
|
||||
exit 1
|
||||
|
||||
build:
|
||||
strategy:
|
||||
|
Reference in New Issue
Block a user