From 247ea431de4ab14f72917c17c9ab3c0bc1ea3819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20Magyar?= Date: Tue, 9 Jun 2026 20:28:08 +0100 Subject: [PATCH] fix(ci): make the prebuild PR push re-run-safe (--force-with-lease -> --force) (#2123) --- .github/workflows/build-tree-sitter-prebuilds.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-tree-sitter-prebuilds.yml b/.github/workflows/build-tree-sitter-prebuilds.yml index e2e4f6601..6f9c54095 100644 --- a/.github/workflows/build-tree-sitter-prebuilds.yml +++ b/.github/workflows/build-tree-sitter-prebuilds.yml @@ -507,7 +507,13 @@ jobs: run(`git commit -m "chore(vendor): rebuild native prebuilds (${grammars})\n\nBuilt by ${process.env.RUN_URL}"`); const { owner, repo } = context.repo; const remote = `https://x-access-token:${process.env.GH_TOKEN}@github.com/${owner}/${repo}.git`; - run(`git push --force-with-lease "${remote}" "HEAD:${branch}"`); + // Plain --force, not --force-with-lease: the branch is ephemeral and + // unique per run (keyed by context.runId), written ONLY by this job, so + // there is no concurrent writer to protect against. --force-with-lease + // would compare against a remote-tracking ref this fresh checkout never + // fetched, so re-running the SAME run (branch already pushed by attempt + // 1) fails with "stale info" instead of overwriting. + run(`git push --force "${remote}" "HEAD:${branch}"`); const body = [ `Rebuilt the vendored native prebuilds for: **${grammars}**.`, '',