Repository navigation
fix(ci): drop ref dev from the sync-main-to-dev job checkout - #1037
Merged
Merged
Conversation
Pin the invariant that both sync-main-to-dev workflows check out the triggering main SHA (default ref) rather than a pinned ref: dev, since the sync job runs a local composite action that only exists on the newer tree. Fails until ref: dev is dropped. Refs: #1034
The sync job in both sync-main-to-dev workflows checked out ref: dev and then invoked a local composite action (uses: ./.github/actions/...), which GitHub resolves against the checked-out workspace. When main added or renamed a local action absent from dev, the job died on its first run — a bootstrap deadlock, since the only PR that would carry the action onto dev was the very sync PR the job could no longer open. Check out the default ref (the triggering main SHA) instead, where the local action is guaranteed to exist, and rename the step accordingly. Every downstream step already operates on origin/main, origin/dev or the gh API, so behavior is otherwise unchanged. Refs: #1034
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.
Summary
Fixes the bootstrap deadlock from #1034 (observed live in vig-os/commit-action adopting devkit 1.1.0): the
syncjob checked outref: devand then invoked a local composite action that may only exist onmain— GitHub resolvesuses: ./...against the checked-out workspace, so the job died the momentmainintroduced a local actiondevdidn't have yet, and the only thing that would carry it todevwas the sync PR the job could no longer open.Fix per the issue's proposal: drop
ref: devfrom the checkout (workspace = the triggeringmainSHA, where the action is guaranteed to exist) in both copies — devkit's own workflow and the scaffold template. The two files are not manifest-linked (verified againstscripts/manifest.toml), so both are edited directly.Verified end-to-end that no subsequent step in either
syncjob depends on the local working tree: every step fetches and operates onorigin/main/origin/devrefs (rev-list,merge-tree,checkout -b ... origin/main) or the gh API — the ref switch is behavior-preserving.TDD: new YAML-shape test
tests/test_workflow_sync_checkout.py(parametrized over both copies), RED before the fix, GREEN after.Not included (follow-up candidate per the issue): a scaffold-lint rule "a job that checks out a non-default ref must not
uses: ./...".Test evidence
uv run pytest tests/test_workflow_sync_checkout.py→ 2 passed (confirmed RED first)bats tests/bats/just.batscomposite-usage assertion still holdsprek run --all-files→ green (re-verified independently before push)Closes #1034