fix(ci): pass Go image tag from build to gitops via artifact #41
Reference in New Issue
Block a user
Delete Branch "fix/gitops-pass-tag-via-artifact"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
github.event.workflow_run.head_branchis not populated for tag pushes in Gitea Actions (it's empty), so the image resolved to...:⁻gowith no version.Fix
build.yaml— at the end of thebuild-gojob, write the full image reference to/tmp/go-image-tag.txtand upload it as ago-image-tagartifact (1-day retention).gitops-update.yaml— when triggered byworkflow_run, download that artifact viaactions/download-artifact@v4withrun-id: ${{ github.event.workflow_run.id }}, then read the image fromgo-image-tag.txt. Theworkflow_dispatchpath is unchanged.