Skip to content

Commit 74b0e4c

Browse files
authored
Merge pull request #118 from tailscale/mpminardi/create-release-when-tests-skipped
.github/workflows: ensure that create_release runs if we skip tests
2 parents 8c8c530 + b7c5a81 commit 74b0e4c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/build.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ jobs:
8181

8282
create_release:
8383
runs-on: ubuntu-24.04
84-
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name)
84+
# By default, the "if" check here is skipped if one of the jobs in the "needs" block
85+
# has been skipped. Adding `always()` ensures that we perform the check even if one
86+
# of the jobs is skipped. We must check that the result of `build_release` is
87+
# "success" and that `test` is one of "success" or "skipped" as a result to ensure
88+
# we are only creating a release when the `test` job has suceeded or been skipped.
89+
if: always() && contains(needs.build_release.result, 'success') && (contains(needs.test.result, 'success') || contains(needs.test.result, 'skipped')) && contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name)
8590
needs: [test, build_release]
8691
outputs:
8792
url: ${{ steps.create_release.outputs.upload_url }}

0 commit comments

Comments
 (0)