ci(release): check out the event sha into a per-job directory (release and rc-release) #50
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/eco-81-release-isolated-checkout"
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?
Found by: ECO-81 card (bread stable release workflow still clones into the shared src path). Same class as ECO-79, which fixed check.yml and dev-release.yml in PR #49.
What changed
.forgejo/workflows/release.yml(stablev*tags): the checkout step no longer runsrm -rf src && mkdir srcand clones the tag name into the shared workspace. It now uses the same inline bootstrap ascheck.ymlanddev-release.yml, which mirrors bread-ecosystemscripts/ci-checkout.sh(merged at c6442cab):GITHUB_SHAis a full 40-hex commit idmktemp -da per-job directory underRUNNER_TEMPBREAD_CI_JOB_DIRthroughGITHUB_ENVgit clone --no-checkout, detaches atGITHUB_SHA, and verifies HEAD equals itsrcreference (build, test, publish debug symbols, prepare artifacts) now reads from"$BREAD_CI_JOB_DIR/src".if: always()stepclean owned checkoutremoves only that directory, and only when it matches${RUNNER_TEMP}/bread-ci.*..forgejo/workflows/rc-release.yml(vX.Y.Z-rc.Ntags): same change, since it has the identicalrm -rf srcpattern. Included in this PR as the card asked us to check it.Unchanged: version computation (from the tag), artifact paths under
/srv/breadway-dl(stable and beta), strip and sha256 steps, minisign index regeneration, and thegh release create/uploadstep.Tag events
Tags in this repo are lightweight (
git cat-file -t v0.9.0-rc.1reportscommit), soGITHUB_SHAon a tag push is the tagged commit and theHEAD == GITHUB_SHAcheck holds. The local fixture also confirmed this for a lightweight tag.Deviation from the card
The card asks for a pinned helper fetch with a committed SHA-256. This PR uses the inline bootstrap, as
check.ymlanddev-release.ymldo, so the three workflows stay identical. Replacing it with a pinned fetch plus hash check is a follow-up.How verified
python3 -c 'import yaml; yaml.safe_load(...)'passes forrelease.yml,rc-release.yml,check.yml, anddev-release.yml.bash -npasses for everyrun:block inrelease.ymlandrc-release.yml.srcshows no barecd src,src/, orrm -rf srcleft. The only remainingsrctokens are the"$checkout/src"clone and checkout lines, which are intended.GITHUB_SHAis rejected; a lightweight tag at the event SHA checks out correctly.Not run
release.ymlandrc-release.ymlon the self-hosted runner. They only run on tag pushes, and this PR does not push tags or trigger releases./srv/breadway-dlwrite or gh upload.Refs ECO-81
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.