Repository navigation
fix(ci): record checkout SHA from the checkout action output - #2056
Merged
Merged
Conversation
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.
Description
#2031 added a
Record checkout SHAstep (CHECKOUT_SHA=$(git rev-parse HEAD)) right afteractions/checkoutand beforeSet up devkit toolchain. In acontainer:job, git refuses the workspace as "dubious ownership" (exit 128) untilsetup-devkit-toolchainmarks it asafe.directory. That broke the 1.19.0-rc4 smoke test (Prepare Release run 42151390302). This PR takes the SHA fromactions/checkout's documentedcommitoutput, so no git call is needed. Release blocker for 1.19.0 (#2033).Type of Change
fix-- Bug fixtest-- Adding or updating testsModifiers
!) -- This change breaks backward compatibilityChanges Made
actions/checkout(devkit.github/workflows: prepare-release ×2, prepare-release-extension, prepare-hotfix, release, abandon-release, sync-issues, update-nixpkgs, update-nixpkgs-unstable; consumerassets/workspace/.github/workflows: prepare-release ×2, prepare-hotfix, release-core, abandon-release, sync-issues):id: checkout.CHECKOUT_SHA: ${{ steps.checkout.outputs.commit }}throughenv:. Nothing is interpolated intorun:.::error::, exit 1) when the output is empty.checkout-state, the outputsha, everyBASE_SHAconsumer and theRequire pinned commit baseguards are unchanged.actions/checkout@3d3c42e5(v7.0.1) declaresoutputs.commitin itsaction.yml.src/git-source-provider.tssets it fromgit log -1 --format=%Hafter checkout.git rev-parseon purpose: the extension's dev fallback (dev-checkout-state) and sync-main-to-dev in both trees.git checkoutstep, so HEAD is no longer the commitactions/checkoutreported, and that output would be the wrong base.tests/test_workflow_checkout_sha.pyscans every workflow in both trees:container:key, norun:step may invoke git before the step that setssafe.directory. That step is./.github/actions/setup-devkit-toolchain, whose "Configure in-container toolchain env" step runsgit config --global --add safe.directory "$GITHUB_WORKSPACE"; the test asserts that line exists.Record checkout SHAafteractions/checkoutmust read that step'scommitoutput, use no git and fail closed when it is empty.test_commit_action_base_sha.py,test_abandon_release.py) now seed the checkoutcommitoutput. The fail-closed tests check that an empty output stops the job with exit 1 (git-based captures still surface git's exit code).docs/RELEASE_CYCLE.mddocuments the capture rule and the reason for the exception.Changelog Entry
Under
## [1.19.0] - TBD→### Fixed(release branch):actions/checkout'scommitoutput, so Prepare Release, Prepare Hotfix, Release and Sync Issues no longer fail with "dubious ownership" (exit 128) indevcontainer/bothmode.safe.directorysetup.Testing
Manual Testing Details
test(ci): ...):pytest tests/test_workflow_checkout_sha.pygave 20 failed and 23 passed, exit 1. The failures were 5 container jobs running git before safe.directory (consumer prepare-hotfix:prepare, prepare-release:prepare and :rollback, release-core:finalize, sync-issues:sync) and 15 captures.test_commit_action_base_sha.pyandtest_abandon_release.pygave 181 passed, exit 0.Checklist
CHANGELOG.md(release section, per release-branch fix) and pasted the entry aboveAdditional Notes
Targets
release/1.19.0, notdev: it fixes the 1.19.0 release candidate. After merge, the next RC smoke run is the end-to-end proof.Refs: #2055