Skip to content

Commit b306491

Browse files
committed
ci: publish job skipped on tag push due to empty workflow_run.ref
github.event.workflow_run.ref is always empty when the upstream workflow is triggered by a tag push, so the ref-based if condition on the publish job never passed. Introduce build_release.yml as a dedicated v* tag trigger that calls build.yml via workflow_call, and update publish.yml to listen to it. This removes the ref inspection needed since the trigger workflow `Daffodil Build Release` is itself the gate.
1 parent 9a5f8cb commit b306491

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- develop
7-
tags: ["v*"]
87
workflow_call:
98
inputs:
109
ref:
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Daffodil Build Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
name: Build Release
11+
uses: ./.github/workflows/build.yml
12+
with:
13+
cache-mode: 'read-write'
14+
ref: ${{ github.sha }}
15+
secrets:
16+
NX_KEY: ${{ secrets.NX_KEY }}
17+
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_NX_CACHE_READWRITE_CONNECTION_STRING }}

.github/workflows/publish.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Publish Release
33
on:
44
workflow_run:
55
workflows:
6-
- Daffodil Build
6+
- Daffodil Build Release
77
types:
88
- completed
99
workflow_dispatch:
@@ -21,13 +21,13 @@ jobs:
2121
runs-on: ubuntu-latest
2222
name: Publish
2323
if: |
24-
(github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.ref, 'refs/tags/v')) ||
24+
(github.event.workflow_run.conclusion == 'success') ||
2525
(github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/tags/v'))
2626
2727
steps:
2828
- uses: actions/checkout@v6
2929
with:
30-
ref: ${{ github.event.workflow_run.ref || github.ref }}
30+
ref: ${{ github.event.workflow_run.head_sha || github.ref }}
3131
fetch-depth: 1
3232

3333
- uses: graycoreio/github-actions/setup-node@main
@@ -48,6 +48,4 @@ jobs:
4848
- uses: graycoreio/github-actions/set-versions-from-root@main
4949

5050
- run: npx nx run-many -t publish
51-
if: >
52-
github.event.workflow_run.conclusion == 'success' &&
53-
startsWith(github.event.workflow_run.ref, 'refs/tags/v')
51+
if: github.event.workflow_run.conclusion == 'success'

0 commit comments

Comments
 (0)