You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both release.yml and build.yml trigger on push to main. build.yml takes ~10 min to build and push :latest, while tag-docker-release completes in ~15 seconds. This meant every release tag was consistently one version behind.
Fix race condition where tag-docker-release pulls :latest before build.yml has finished pushing it, causing every versioned Docker tag to point to the previous release's image
Add a wait step that uses gh run watch to block until build.yml completes for the exact commit SHA before pulling and re-tagging :latest
Skip the wait on workflow_dispatch so manual re-tagging (recovery) still works immediately
Align paths-ignore between release.yml and build.yml to prevent release triggering without a corresponding build
Add 15-minute timeout on the wait step
Category of change
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Build: a code change that affects the build system or external dependencies
Performance: a code change that improves performance
Refactor: a code change that neither fixes a bug nor adds a feature
Documentation: documentation changes
Breaking change (fix or feature that would cause existing functionality to not work as expected)
Checklist
I have run just test and all tests pass
I have reviewed my own diff and added inline comments on lines I want reviewers to focus on or that I am uncertain about
Good fix — the race condition diagnosis is correct and using gh run watch to block on the exact commit's build run is clean and straightforward.
1. paths-ignore alignment is incomplete
release.yml retains .github/workflows/** in paths-ignore but build.yml does not. A workflow-only push to main would trigger build.yml (new :latest) but skip release.yml — so tag-docker-release wouldn't run. In practice this is probably harmless (no semantic-release = no new tag = nothing to do), but it contradicts the PR description's "align paths-ignore" claim. Worth either truly aligning them or noting the intentional divergence in a comment.
2. Latent race on gh run list lookup
Both workflows trigger on push, but release.yml's release job (semantic-release) must complete before tag-docker-release starts. It's possible that when the gh run list --commit call executes, the build.yml run hasn't been registered by GitHub's API yet. Semantic-release likely takes long enough to mask this today, but a small retry loop would make it robust against future speedups:
foriin$(seq 1 5);do
RUN_ID=$(gh run list \ --workflow="build.yml" \ --branch=main \ --commit="${{ github.sha }}" \ --limit=1 \ --json databaseId \ --jq '.[0].databaseId')
[ -n"$RUN_ID" ] &&breakecho"Build run not found yet, retrying in 10s..."
sleep 10
done
3. Error message is clear — The ::error:: annotation when RUN_ID is empty is good UX in the Actions UI.
4. workflow_dispatch skip — Skipping the wait for manual recovery is a sensible escape hatch. Inline comments explaining "why" are helpful.
5. Self-review checklist — Per repo conventions, the PR author is expected to review their own diff and add inline comments on areas of concern. The checklist items in the PR body are unchecked.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Both
release.ymlandbuild.ymltrigger on push to main.build.ymltakes ~10 min to build and push:latest, whiletag-docker-releasecompletes in ~15 seconds. This meant every release tag was consistently one version behind.tag-docker-releasepulls:latestbeforebuild.ymlhas finished pushing it, causing every versioned Docker tag to point to the previous release's imagegh run watchto block untilbuild.ymlcompletes for the exact commit SHA before pulling and re-tagging:latestworkflow_dispatchso manual re-tagging (recovery) still works immediatelypaths-ignorebetweenrelease.ymlandbuild.ymlto prevent release triggering without a corresponding buildCategory of change
Checklist
just testand all tests pass