Skip to content

build: fix markdown_equations push failure when PR branch exists#13110

Draft
Planeshifter wants to merge 1 commit into
developfrom
philipp/ci-fix-markdown-equations-2026-06-24
Draft

build: fix markdown_equations push failure when PR branch exists#13110
Planeshifter wants to merge 1 commit into
developfrom
philipp/ci-fix-markdown-equations-2026-06-24

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Resolves N/A — automated CI fix; no tracking issue.

Description

What is the purpose of this pull request?

This pull request:

  • fixes a persistent failure in the markdown_equations scheduled workflow where peter-evans/create-pull-request produces error: failed to push some refs when the markdown-insert-equations branch already exists on the remote.

Root cause. The workflow's shallow clone (fetch-depth: 100) only fetches the develop branch. The markdown-insert-equations branch is never fetched, so no local tracking reference exists for it. When peter-evans internally calls git push --force-with-lease origin markdown-insert-equations, git cannot verify the expected remote state against a missing tracking ref and rejects the push.

Fix. A single git fetch origin markdown-insert-equations 2>/dev/null || true is added at the top of the "Delete remote PR branch" step, immediately before the API delete call. This establishes the tracking reference before peter-evans runs. Two outcomes:

  1. Delete succeeds — peter-evans creates the branch from scratch; no force-with-lease concern.
  2. Delete fails (permissions, race) — the tracking reference is present, force-with-lease can verify the remote state, and the push succeeds.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

  • None.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

The workflow has failed on 14 of 15 runs in the past 30 days. The one success (2026-06-19) was likely a run where the markdown-insert-equations branch did not yet exist at push time.

The git commit calls in the "Generate SVG equations" and "Update equation elements" steps are intentionally preserved: the remark-img-equations-src-urls remark plugin calls git rev-list -1 HEAD <svg-file> to obtain a commit SHA for building jsdelivr URLs, so the SVG files must be committed before that plugin runs.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution.

This PR was written primarily by Claude Code as part of an automated CI failure investigation routine. The root-cause analysis (shallow-clone missing the PR branch → missing --force-with-lease tracking ref) and the fix (adding git fetch) were generated and validated by Claude Code. A human operator reviewed the final diff before merge.


@stdlib-js/reviewers


Generated by Claude Code

The `markdown_equations` CI workflow commits SVG and element changes to
the local checkout of `develop`, then uses `peter-evans/create-pull-request`
to push those commits to the `markdown-insert-equations` branch.  The
prior shallow clone only fetches `develop`; the `markdown-insert-equations`
branch is never fetched, so no local tracking reference exists for it.
When peter-evans calls `git push --force-with-lease`, git cannot verify the
expected remote state and rejects the push with
"error: failed to push some refs".

Fix: fetch `markdown-insert-equations` before the delete step so the
tracking reference is established.  If the branch exists and the delete
succeeds, peter-evans creates it fresh (no force-with-lease concern).
If the delete fails (e.g. permissions), the tracking reference lets
force-with-lease verify the remote state and the push succeeds.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JxM7pSh76qaHqGoSgENEda
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.

2 participants