Skip to content

Commit bbe54f0

Browse files
authored
Change test/lint workflow to correctly report completion status (#6257)
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
1 parent 1e2556a commit bbe54f0

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

.github/workflows/lint.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,18 @@ jobs:
5050
# It is used to set as required check for the branch protection rules
5151
go-lint-completed:
5252
runs-on: ubuntu-24.04
53+
if: always()
5354
needs: go
5455
steps:
55-
- run: |
56-
echo completed
56+
- name: Check if all go lint jobs succeeded
57+
# if jobs in the 'go' job matrix failed or were cancelled, this job will fail
58+
# otherwise this job is marked as successful because all steps are skipped
59+
run: exit 1
60+
if: >-
61+
${{
62+
contains(needs.*.result, 'failure')
63+
|| contains(needs.*.result, 'cancelled')
64+
}}
5765
5866
web:
5967
runs-on: ubuntu-24.04

.github/workflows/test.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,18 @@ jobs:
5858
# It is used to set as required check for the branch protection rules
5959
go-test-completed:
6060
runs-on: ubuntu-24.04
61+
if: always()
6162
needs: go
6263
steps:
63-
- run: |
64-
echo completed
64+
- name: Check if all go test jobs succeeded
65+
# if jobs in the 'go' job matrix failed or were cancelled, this job will fail
66+
# otherwise this job is marked as successful because all steps are skipped
67+
run: exit 1
68+
if: >-
69+
${{
70+
contains(needs.*.result, 'failure')
71+
|| contains(needs.*.result, 'cancelled')
72+
}}
6573
6674
web:
6775
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)