Skip to content

Commit a696866

Browse files
committed
fix: chain docker publish from release workflow
GitHub's anti-recursion rule prevents workflows from triggering other workflows when acting as GITHUB_TOKEN. publish-release.yml pushes the release tag with the default token, so the push:tags:v* trigger on publish-docker.yml never fires. Result: v1.11.0 through v1.14.3 all published to npm but no Docker image reached GHCR, and the v1.14.3 OOM fix never made it to the Railway service pulling ghcr.io/copilotkit/aimock:latest. Fix by explicitly dispatching publish-docker.yml via `gh workflow run --ref <TAG>` after the npm publish step succeeds. This does not depend on tag-trigger behavior and is guarded by the same steps.check.outputs.published == 'false' condition as the publish, so Docker only builds when npm publish actually happened. Also restore the workflow_dispatch trigger on publish-docker.yml (added in 486ccd9, inadvertently removed in 63aab1e); `gh workflow run` requires workflow_dispatch on the ref being invoked. The existing push:tags:v* trigger stays as belt-and-suspenders for anyone pushing tags manually from a local clone with a PAT. Option chosen: explicit chain over PAT or workflow_call. Least invasive (no new secrets, no cross-workflow refactor), most observable (the dispatch shows up as a discrete step in the release run), and the failure mode is clearly visible in the release workflow log.
1 parent db21dcd commit a696866

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/publish-docker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
pull_request:
88
branches:
99
- main
10+
workflow_dispatch:
1011

1112
env:
1213
REGISTRY: ghcr.io

.github/workflows/publish-release.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
permissions:
1111
contents: write
1212
id-token: write
13+
actions: write
1314
steps:
1415
- uses: actions/checkout@v4
1516
with: { fetch-depth: 0 }
@@ -81,6 +82,17 @@ jobs:
8182
env:
8283
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8384

85+
- name: Trigger Docker publish workflow
86+
# GitHub's anti-recursion rule: tags pushed by GITHUB_TOKEN do NOT
87+
# trigger downstream workflows. Explicitly dispatch publish-docker.yml
88+
# so the GHCR image actually gets built on every release.
89+
if: steps.check.outputs.published == 'false'
90+
run: |
91+
TAG="v${{ steps.check.outputs.version }}"
92+
gh workflow run publish-docker.yml --ref "${TAG}"
93+
env:
94+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95+
8496
- name: Notify Slack
8597
if: steps.check.outputs.published == 'false'
8698
run: |

0 commit comments

Comments
 (0)