Skip to content

fix: resolve YAML syntax error in merge-bot workflow#21

Merged
vilsonrodrigues merged 1 commit intomsgflux:mainfrom
vilsonrodrigues:fix/mergebot-yaml-syntax
Dec 1, 2025
Merged

fix: resolve YAML syntax error in merge-bot workflow#21
vilsonrodrigues merged 1 commit intomsgflux:mainfrom
vilsonrodrigues:fix/mergebot-yaml-syntax

Conversation

@vilsonrodrigues
Copy link
Contributor

Summary

This PR fixes a critical YAML syntax error in the merge-bot workflow that is preventing the workflow from running correctly.

Problem

The workflow file has an error on line 420 that causes GitHub Actions to fail parsing the file:

Error: You have an error in your yaml syntax on line 420

Root cause: The JavaScript template literal contains ${pr.base.ref} which GitHub Actions' YAML parser is interpreting as an attempt at variable interpolation, causing a syntax error.

body: `...
\`\`\`bash
git fetch upstream ${pr.base.ref}   // ❌ Causes YAML parsing error
git merge upstream/${pr.base.ref}
git push
\`\`\`
...`

Solution

Extract pr.base.ref to a local variable before using it in the template literal:

const baseBranch = pr.base.ref;      // ✅ Extract to variable
await github.rest.issues.createComment({
  ...
  body: `...
\`\`\`bash
git fetch upstream ${baseBranch}    // ✅ Use local variable
git merge upstream/${baseBranch}
git push
\`\`\`
...`
});

Changes

  • Add const baseBranch = pr.base.ref; before the comment creation
  • Replace ${pr.base.ref} with ${baseBranch} in the template string

Impact

Fixes workflow validation: GitHub Actions will accept the workflow file
No functional changes: The behavior remains exactly the same
Enables /update command: The update command can now work properly

Testing

After merge:

Related

🤖 Generated with Claude Code

Fix template literal interpolation issue by extracting pr.base.ref to
a local variable before using it in the comment body. This prevents
YAML parsing errors with the GitHub Actions workflow.

The issue occurs when GitHub Actions tries to parse the workflow file
and encounters ${pr.base.ref} inside a JavaScript template literal,
which can be confused with GitHub Actions variable interpolation syntax.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vilsonrodrigues vilsonrodrigues merged commit f3dd729 into msgflux:main Dec 1, 2025
7 checks passed
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.

1 participant