Skip to content

Commit a15a5d7

Browse files
cteclaude
andcommitted
fix: replace heredocs with echo statements in cli-release workflow
The YAML parser (used by knip and potentially stricter GitHub Actions validation) was failing to parse heredocs that started at column 1 within multiline run scripts. Replace: - Wrapper script heredoc with printf statements - Release notes heredoc with echo statements to a temp file Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 4592133 commit a15a5d7

File tree

1 file changed

+62
-65
lines changed

1 file changed

+62
-65
lines changed

.github/workflows/cli-release.yml

Lines changed: 62 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -128,23 +128,22 @@ jobs:
128128
129129
# Create the wrapper script
130130
echo "Creating wrapper script..."
131-
cat > "$RELEASE_DIR/bin/roo" << 'WRAPPER_EOF'
132-
#!/usr/bin/env node
133-
134-
import { fileURLToPath } from 'url';
135-
import { dirname, join } from 'path';
136-
137-
const __filename = fileURLToPath(import.meta.url);
138-
const __dirname = dirname(__filename);
139-
140-
// Set environment variables for the CLI
141-
process.env.ROO_CLI_ROOT = join(__dirname, '..');
142-
process.env.ROO_EXTENSION_PATH = join(__dirname, '..', 'extension');
143-
process.env.ROO_RIPGREP_PATH = join(__dirname, 'rg');
144-
145-
// Import and run the actual CLI
146-
await import(join(__dirname, '..', 'lib', 'index.js'));
147-
WRAPPER_EOF
131+
printf '%s\n' '#!/usr/bin/env node' \
132+
'' \
133+
"import { fileURLToPath } from 'url';" \
134+
"import { dirname, join } from 'path';" \
135+
'' \
136+
'const __filename = fileURLToPath(import.meta.url);' \
137+
'const __dirname = dirname(__filename);' \
138+
'' \
139+
'// Set environment variables for the CLI' \
140+
"process.env.ROO_CLI_ROOT = join(__dirname, '..');" \
141+
"process.env.ROO_EXTENSION_PATH = join(__dirname, '..', 'extension');" \
142+
"process.env.ROO_RIPGREP_PATH = join(__dirname, 'rg');" \
143+
'' \
144+
'// Import and run the actual CLI' \
145+
"await import(join(__dirname, '..', 'lib', 'index.js'));" \
146+
> "$RELEASE_DIR/bin/roo"
148147
149148
chmod +x "$RELEASE_DIR/bin/roo"
150149
@@ -309,63 +308,61 @@ WRAPPER_EOF
309308
CHANGELOG_CONTENT: ${{ steps.changelog.outputs.content }}
310309
CHECKSUMS: ${{ steps.checksums.outputs.checksums }}
311310
run: |
312-
WHATS_NEW=""
313-
if [ -n "$CHANGELOG_CONTENT" ]; then
314-
WHATS_NEW="## What's New
311+
NOTES_FILE=$(mktemp)
315312
316-
$CHANGELOG_CONTENT
317-
318-
"
313+
if [ -n "$CHANGELOG_CONTENT" ]; then
314+
echo "## What's New" >> "$NOTES_FILE"
315+
echo "" >> "$NOTES_FILE"
316+
echo "$CHANGELOG_CONTENT" >> "$NOTES_FILE"
317+
echo "" >> "$NOTES_FILE"
319318
fi
320319
321-
RELEASE_NOTES=$(cat << EOF
322-
${WHATS_NEW}## Installation
323-
324-
\`\`\`bash
325-
curl -fsSL https://raw.githubusercontent.com/RooCodeInc/Roo-Code/main/apps/cli/install.sh | sh
326-
\`\`\`
327-
328-
Or install a specific version:
329-
\`\`\`bash
330-
ROO_VERSION=$VERSION curl -fsSL https://raw.githubusercontent.com/RooCodeInc/Roo-Code/main/apps/cli/install.sh | sh
331-
\`\`\`
332-
333-
## Requirements
334-
335-
- Node.js 20 or higher
336-
- macOS (Intel or Apple Silicon) or Linux x64
337-
338-
## Usage
339-
340-
\`\`\`bash
341-
# Run a task
342-
roo "What is this project?"
343-
344-
# See all options
345-
roo --help
346-
\`\`\`
347-
348-
## Platform Support
349-
350-
This release includes binaries for:
351-
- \`roo-cli-darwin-arm64.tar.gz\` - macOS Apple Silicon (M1/M2/M3)
352-
- \`roo-cli-darwin-x64.tar.gz\` - macOS Intel
353-
- \`roo-cli-linux-x64.tar.gz\` - Linux x64
354-
355-
## Checksums
356-
357-
\`\`\`
358-
${CHECKSUMS}
359-
\`\`\`
360-
EOF
361-
)
320+
echo "## Installation" >> "$NOTES_FILE"
321+
echo "" >> "$NOTES_FILE"
322+
echo '```bash' >> "$NOTES_FILE"
323+
echo "curl -fsSL https://raw.githubusercontent.com/RooCodeInc/Roo-Code/main/apps/cli/install.sh | sh" >> "$NOTES_FILE"
324+
echo '```' >> "$NOTES_FILE"
325+
echo "" >> "$NOTES_FILE"
326+
echo "Or install a specific version:" >> "$NOTES_FILE"
327+
echo '```bash' >> "$NOTES_FILE"
328+
echo "ROO_VERSION=$VERSION curl -fsSL https://raw.githubusercontent.com/RooCodeInc/Roo-Code/main/apps/cli/install.sh | sh" >> "$NOTES_FILE"
329+
echo '```' >> "$NOTES_FILE"
330+
echo "" >> "$NOTES_FILE"
331+
echo "## Requirements" >> "$NOTES_FILE"
332+
echo "" >> "$NOTES_FILE"
333+
echo "- Node.js 20 or higher" >> "$NOTES_FILE"
334+
echo "- macOS (Intel or Apple Silicon) or Linux x64" >> "$NOTES_FILE"
335+
echo "" >> "$NOTES_FILE"
336+
echo "## Usage" >> "$NOTES_FILE"
337+
echo "" >> "$NOTES_FILE"
338+
echo '```bash' >> "$NOTES_FILE"
339+
echo "# Run a task" >> "$NOTES_FILE"
340+
echo 'roo "What is this project?"' >> "$NOTES_FILE"
341+
echo "" >> "$NOTES_FILE"
342+
echo "# See all options" >> "$NOTES_FILE"
343+
echo "roo --help" >> "$NOTES_FILE"
344+
echo '```' >> "$NOTES_FILE"
345+
echo "" >> "$NOTES_FILE"
346+
echo "## Platform Support" >> "$NOTES_FILE"
347+
echo "" >> "$NOTES_FILE"
348+
echo "This release includes binaries for:" >> "$NOTES_FILE"
349+
echo '- `roo-cli-darwin-arm64.tar.gz` - macOS Apple Silicon (M1/M2/M3)' >> "$NOTES_FILE"
350+
echo '- `roo-cli-darwin-x64.tar.gz` - macOS Intel' >> "$NOTES_FILE"
351+
echo '- `roo-cli-linux-x64.tar.gz` - Linux x64' >> "$NOTES_FILE"
352+
echo "" >> "$NOTES_FILE"
353+
echo "## Checksums" >> "$NOTES_FILE"
354+
echo "" >> "$NOTES_FILE"
355+
echo '```' >> "$NOTES_FILE"
356+
echo "$CHECKSUMS" >> "$NOTES_FILE"
357+
echo '```' >> "$NOTES_FILE"
362358
363359
gh release create "$TAG" \
364360
--title "Roo Code CLI v$VERSION" \
365-
--notes "$RELEASE_NOTES" \
361+
--notes-file "$NOTES_FILE" \
366362
--prerelease \
367363
release/*
368364
365+
rm -f "$NOTES_FILE"
369366
echo "Release created: https://github.com/${{ github.repository }}/releases/tag/$TAG"
370367
371368
# Summary job for dry runs

0 commit comments

Comments
 (0)