Skip to content

Fix syntax error in auto-merge-dev-prs.yml github-script - #289

Open
TheWeirdDee wants to merge 1 commit into
zkpayroll:devfrom
TheWeirdDee:fix/auto-merge-dev-pr-template-literals
Open

Fix syntax error in auto-merge-dev-prs.yml github-script#289
TheWeirdDee wants to merge 1 commit into
zkpayroll:devfrom
TheWeirdDee:fix/auto-merge-dev-pr-template-literals

Conversation

@TheWeirdDee

Copy link
Copy Markdown
Contributor

Summary

Not tied to a specific issue — found while working on #279 and #284, both of which were blocked by this.

The handle-dev-pr job (.github/workflows/auto-merge-dev-prs.yml) fails on every PR targeting dev, regardless of that PR's own content or CI status:

SyntaxError: missing ) after argument list

Three of the comment(...) calls embed literal backticks around dev inside an outer template literal:

await comment(`${mention} this PR has merge conflicts with `dev`. Please resolve...`);

The inner `dev` closes the outer template literal early, leaving a dangling backtick that breaks the argument list. Since this is inside a single actions/github-script step, the whole script fails to parse before any of its logic (CI check, mergeability check, auto-merge) ever runs — so handle-dev-pr shows as a hard failure on every PR, independent of whether the PR's actual code/CI is fine.

Fix

Escaped the inner backticks (\`dev\`) in all three call sites so they render as literal backtick-quoted text in the posted PR comment instead of terminating the template literal early. No behavioral change to the automation logic — same three messages, now they actually get posted instead of crashing first.

Verification

Extracted the script: block scalar and checked it in isolation:

node --check extracted_script.js   # exit 0, no syntax errors

(Can't fully exercise waitForCi/merge logic locally since it depends on the GitHub Actions github/context objects, but the fix is a pure syntax correction — no logic touched.)

The three comment() calls that mention `dev` embedded unescaped
backticks inside an outer template literal (`... with `dev`. ...`),
which terminates the literal early and leaves a stray backtick that
breaks the argument list. Node fails to parse the whole script with
"SyntaxError: missing ) after argument list" before it ever runs, so
the handle-dev-pr check fails on every PR targeting dev regardless of
that PR's own content or CI status.

Escaped the inner backticks (\`dev\`) so they render as literal
backtick-quoted text in the posted comment instead of breaking out of
the template literal. Verified the extracted script parses cleanly
with `node --check`.
@edehvictor

edehvictor commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

@TheWeirdDee kindly fix conflicts and make CI pass

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

@TheWeirdDee this PR currently has merge conflicts.

Please resolve the conflicts before it can be merged automatically.

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