Skip to content

fix(ci): drop ref dev from the sync-main-to-dev job checkout - #1037

Merged
c-vigo merged 3 commits into
devfrom
bugfix/1034-sync-workflow-checkout
Jul 14, 2026
Merged

c-vigo merged 3 commits into
devfrom
bugfix/1034-sync-workflow-checkout

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the bootstrap deadlock from #1034 (observed live in vig-os/commit-action adopting devkit 1.1.0): the sync job checked out ref: dev and then invoked a local composite action that may only exist on main — GitHub resolves uses: ./... against the checked-out workspace, so the job died the moment main introduced a local action dev didn't have yet, and the only thing that would carry it to dev was the sync PR the job could no longer open.

Fix per the issue's proposal: drop ref: dev from the checkout (workspace = the triggering main SHA, 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 against scripts/manifest.toml), so both are edited directly.

Verified end-to-end that no subsequent step in either sync job depends on the local working tree: every step fetches and operates on origin/main/origin/dev refs (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.bats composite-usage assertion still holds
  • prek run --all-files → green (re-verified independently before push)

Closes #1034

c-vigo added 3 commits July 14, 2026 10:10
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
@c-vigo
c-vigo merged commit dca50b5 into dev Jul 14, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/1034-sync-workflow-checkout branch July 14, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant