Fix syntax error in auto-merge-dev-prs.yml github-script - #289
Open
TheWeirdDee wants to merge 1 commit into
Open
Fix syntax error in auto-merge-dev-prs.yml github-script#289TheWeirdDee wants to merge 1 commit into
TheWeirdDee wants to merge 1 commit into
Conversation
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`.
Contributor
|
@TheWeirdDee kindly fix conflicts and make CI pass |
|
@TheWeirdDee this PR currently has merge conflicts. Please resolve the conflicts before it can be merged automatically. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Not tied to a specific issue — found while working on #279 and #284, both of which were blocked by this.
The
handle-dev-prjob (.github/workflows/auto-merge-dev-prs.yml) fails on every PR targetingdev, regardless of that PR's own content or CI status:Three of the
comment(...)calls embed literal backticks arounddevinside an outer template literal:The inner
`dev`closes the outer template literal early, leaving a dangling backtick that breaks the argument list. Since this is inside a singleactions/github-scriptstep, the whole script fails to parse before any of its logic (CI check, mergeability check, auto-merge) ever runs — sohandle-dev-prshows 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 Actionsgithub/contextobjects, but the fix is a pure syntax correction — no logic touched.)