Skip to content

Commit e88bd4a

Browse files
committed
.github/workflows: add always() logic to upload_release job
Add `always()` logic to `upload_release` job as it seems like using the `always()` hack in an upstream `needs` dependency may force downstream jobs to also use `always()`, presumably because GitHub is doing transitive dependency checking upstream and sees that the original `test` job was skipped. Pass explicit `commitsh` argument to the `create-release` action to ensure the resulting tag / release is tied to the intended SHA and not the branch the job was triggered from. As an example, before this change triggering the workflow from the `tailscale.go1.24` branch would always result in the tag being added to the head of `tailscale.go1.24` instead of at the `ref` that the release was actually built from. Updates #47 Signed-off-by: Mario Minardi <[email protected]>
1 parent 74b0e4c commit e88bd4a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/workflows/build.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ jobs:
100100
# Release name can't be the same as tag name, sigh
101101
tag_name: build-${{ inputs.ref || github.sha }}
102102
release_name: ${{ inputs.ref || github.sha }}
103+
commitish: ${{ inputs.ref || github.sha }}
103104
draft: false
104105
prerelease: true
105106

@@ -112,7 +113,10 @@ jobs:
112113
- GOOS: windows
113114
GOARCH: arm64
114115
runs-on: ubuntu-24.04
115-
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name)
116+
# We need to do the `always()` hack here as well since the upstream `create_release` job
117+
# needs it and this seems to transitively require that downstream jobs also have a similar
118+
# check.
119+
if: always() && contains(needs.create_release.result, 'success') && contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name)
116120
needs: [create_release]
117121
steps:
118122
- name: download artifact

0 commit comments

Comments
 (0)