Resolve the tag Charts marker only from a real annotated tag - #1103
Merged
Conversation
actions/checkout fetches a tag push by sha, so refs/tags/<tag> on the runner is lightweight and git tag -l --format='%(body)' falls back to the commit message. A wrapped prose line in 4bb0e8d begins with "Charts:", so the marker resolved to that sentence, staged 0 charts, and publish-oci-charts.sh died on an empty .oci/ glob. Refetch the tag ref, gate the body read on cat-file -t reporting a tag object, and skip the lookup entirely when GITHUB_REF is not a tag. Reject a resolved pattern containing whitespace: a glob is one shell word. stage-charts now fails when nothing matches instead of handing an empty dir downstream. Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The OCI publish job for
v0.36.1failed:Two bugs compounded:
actions/checkoutfetches a tag push by commit sha, sorefs/tags/<tag>points at the commit rather than the annotated tag object.git tag -l --format='%(body)'then falls back to the commit message. Locally the tag is fine —git cat-file -t v0.36.1reportstagand the body isCharts: kubedbcom-*-editor-options.Charts:—Charts: annotated-tag body marker resolve to a glob that make stage-charts. The marker sed matched that prose,find -namematched no dirs, andpublish-oci-charts.shglobbed an empty.oci/.Fix
publish-oci.ymlandrelease.yml(identical block in both):GITHUB_REFas a tag when it is one. Onworkflow_dispatchthe old code fedrefs/heads/mastertogit tag -l.refs/tags/$GIT_TAGexplicitly so the annotated tag object exists, then gate the body read ongit cat-file -t "$GIT_TAG" = tag. A lightweight tag now yields no pattern instead of a commit message.::error::+ exit 1. A glob is one shell word; whitespace means the marker matched prose.Makefile—stage-chartsexits 1 withno charts matched '<glob>'instead of staging zero charts and letting the publish script fail later with an opaque.oci/*: no such file.Verification
The whitespace guard was exercised standalone under
bash -e: errors on prose, passeskubedbcom-*-editor-optionsthrough.Note
v0.36.1still points at 4bb0e8d, whose commit body contains that proseCharts:line. With this fix the annotated body is read correctly so it no longer matters, but the tag needs to be moved to include this commit before the workflow behaves differently.