fix(ci): give OCI release-attach gh repo context and fail loudly#34
Merged
Conversation
Bug: the "Attach OCI bundles to draft release" job runs on a v* tag push with no
checkout and no GH_REPO, so gh cannot resolve the repository. In run 29635376980
(v0.4.0-preview.2) gh release create AND gh release upload both printed
"failed to run git: fatal: not a git repository"; the trailing `|| echo "no
tarballs to attach"` swallowed the upload failure into a green job. No release
has ever received an OCI bundle asset (v0.4.0-preview.1 and .2 both have zero).
The download step already sets merge-multiple: true, so bundles/*.tar.gz did in
fact match all four tarballs — the two "failed to run git" lines prove the upload
command ran and then failed on missing repo context, not a glob miss.
Fix:
- add GH_REPO: ${{ github.repository }} so gh works without a checkout;
- create-if-missing kept, but a create failure now fails the step (no || true);
- require exactly 4 bundle tarballs (build-per-rid legs are hard dependencies) and
fail loudly on any mismatch instead of echoing a misleading message;
- let gh release upload failures fail the step.
Contributor
Contributor
C# coverage
|
Contributor
Scala build matrix
|
Contributor
C# build matrix
|
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
attach-to-draft-releasejob inbuild-oci-codegen-cs.yamlhas silentlynever attached an OCI bundle to any release. Both
v0.4.0-preview.1andv0.4.0-preview.2releases have zero.tar.gzbundle assets.Root cause: no repo context + swallowed failure
The job runs on a
v*tag push with noactions/checkoutstep and noGH_REPO, so theghCLI cannot resolve which repository it is operating on.In evidence run
29635376980
(tag
v0.4.0-preview.2), the attach step log shows:The trailing
|| echo "no tarballs to attach"turned a realgh release uploadfailure into a green job with a misleading message.
The download step was already correct
The
download-artifactstep already setsmerge-multiple: true, so the tarballsdo land flat as
bundles/*.tar.gzand the glob matched all four. Proof: thereare two
failed to run gitlines — one fromgh release create, one fromgh release upload. The upload command only runs when[ ${#files[@]} -gt 0 ]istrue, so the glob was not the problem. The failure was purely missing repo
context, hidden by
|| echo. The download step is therefore left unchanged.Fix (attach step only)
GH_REPO: ${{ github.repository }}soghworks without a checkout.|| trueso a genuinegh release createfailure fails the step.
build-per-ridmatrix legs arehard
needs:dependencies, so any other count means the download step or anupstream build broke — and
::error::+exit 1on mismatch instead of amisleading echo. (Mirrors the
expected_platforms=4guard incompose-index.)gh release uploadfailures fail the step (no|| echo).Validation
actionlintclean on the changed step (the one remaining SC2129 style nit ispre-existing, at the untouched
validate-inputsstep).createCommitOnBranch(server-signed;verified: true).Do not auto-merge.