Skip to content

ci(grammars): merge the grammar repin automatically - #21

Merged
maxgfr merged 1 commit into
mainfrom
claude/auto-merge-grammars-repin-wk48vj
Sep 14, 2026
Merged

maxgfr merged 1 commit into
mainfrom
claude/auto-merge-grammars-repin-wk48vj

Conversation

@maxgfr

@maxgfr maxgfr commented Sep 14, 2026

Copy link
Copy Markdown
Owner

The grammar repin job opened a pull request and stopped there, so every daily run only refreshed a branch nobody merged (#20, open since Sept 11 with green checks). The re-pinned wasm never reached main and never got released — which defeats the point of the job.

What changed

.github/workflows/grammars-repin.yml

  • Added a Node 18 smoke gate mirroring ci.yml's smoke-node18 job (loads scripts/engine.mjs, runs the CLI on the mini-repo fixture). A grammar bump also moves web-tree-sitter's inlined runtime, so this is exactly the regression that must not auto-merge unnoticed. The job now runs every check ci.yml would run on that PR — typecheck, test, reproducible bundle, Node 18 smoke — against the exact committed tree.
  • The job then squash-merges its own pull request and deletes the remote branch. The PR stays as the record of what landed; it is no longer a review gate nobody attends. Squash keeps main at one conventional fix(grammars): ... subject, which is what semantic-release turns into the patch release. Falls back to a merge commit if squashing is disabled on the repo.
  • Branch deletion is an explicit git push origin --delete rather than gh pr merge --delete-branch, since that flag also prunes the local branch the job has checked out; a failed cleanup must not fail a merge that already landed.
  • Dropped the gh workflow run ci.yml dispatch — the PR is merged in the same run, so a CI run against a deleted branch had nothing left to guard.

.github/workflows/release.yml

  • Added a workflow_dispatch trigger. The merge above is performed with GITHUB_TOKEN, so GitHub's anti-recursion rule (already documented in this file for the image publish) keeps the resulting push to main from starting on: push. The repin job dispatches the release run after merging, so the re-pinned grammars are published instead of sitting on main under a stale ENGINE_VERSION. semantic-release is a no-op when nothing releasable landed, so an extra dispatch is harmless.

Notes

  • Self-merging is safe here because every gate runs on the exact bytes being merged, in the job, before the merge — waiting for ci.yml on the branch would only re-run the same checks, and a GITHUB_TOKEN-created PR does not start them by itself.
  • Existing PR fix(grammars): bump tree-sitter grammars and re-vendor wasm #20 needs no manual action: the next repin run (daily at 03:41 UTC, or a manual dispatch) re-pushes that branch, refreshes the PR and merges it.
  • No behavior change when nothing is out of date — the changed=false path still exits early.

🤖 Generated with Claude Code

https://claude.ai/code/session_012xGuFnYS4EJsb9p7PrMLvQ


Generated by Claude Code

The repin job opened a pull request and stopped there, so every daily run
only refreshed a branch nobody merged: the re-pinned wasm never reached
main and never got released, which defeats the point of the job.

It now runs every check ci.yml would run on that pull request — typecheck,
test, reproducible bundle and the Node 18 smoke — inside the job, against
the exact committed tree, then squash-merges its own pull request and
deletes the branch. The pull request stays as the record of what landed;
it is no longer a review gate nobody attends, and the branch commit
subject stays the conventional `fix(grammars): ...` that cuts the patch
release.

Because the merge is performed with GITHUB_TOKEN, GitHub's anti-recursion
rule keeps it from starting release.yml's `on: push`. release.yml gains a
`workflow_dispatch` trigger and the repin job dispatches it after merging,
so the re-pinned grammars are actually published instead of sitting on
main under a stale ENGINE_VERSION.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012xGuFnYS4EJsb9p7PrMLvQ
@maxgfr
maxgfr marked this pull request as ready for review September 14, 2026 07:22
@maxgfr
maxgfr merged commit f9a58a1 into main Sep 14, 2026
2 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.30.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@maxgfr
maxgfr deleted the claude/auto-merge-grammars-repin-wk48vj branch September 15, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants