Skip to content

fix: remove misplaced shebang causing CI syntax error in validate-yaml.js#133

Merged
huangyiirene merged 2 commits intocopilot/add-mit-license-header-againfrom
copilot/update-test-action-steps
Jan 18, 2026
Merged

fix: remove misplaced shebang causing CI syntax error in validate-yaml.js#133
huangyiirene merged 2 commits intocopilot/add-mit-license-header-againfrom
copilot/update-test-action-steps

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 18, 2026

The CI workflow "Validate YAML Metadata" was failing with SyntaxError: Invalid or unexpected token when executing pnpm exec node scripts/validate-yaml.js.

Root Cause

The shebang #!/usr/bin/env node was on line 9 (after the license header) instead of line 1. When Node.js explicitly loads a file, shebangs in non-first-line positions are interpreted as JavaScript code.

// Before (line 9 - causes SyntaxError)
/**
 * LICENSE HEADER
 */

#!/usr/bin/env node  // ❌ Treated as invalid JS syntax
/**
 * Script docs
 */

// After (no shebang needed)
/**
 * LICENSE HEADER
 */

/**
 * Script docs
 */

Changes

  • Removed the misplaced shebang from scripts/validate-yaml.js
  • Shebang is unnecessary since the workflow invokes the script with node explicitly

The script now matches the pattern used by check-versions.js which also runs via explicit node invocation without a shebang.

Original prompt

引用: https://github.com/objectstack-ai/objectql/actions/runs/21106340992/job/60698414476#step:6:1


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

The shebang #!/usr/bin/env node was on line 9 instead of line 1,
causing a SyntaxError when the script was executed with 'node' explicitly.
Since the workflow uses 'pnpm exec node scripts/validate-yaml.js',
the shebang is not needed and has been removed.

Fixes workflow run: https://github.com/objectstack-ai/objectql/actions/runs/21106340992

Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Copilot AI changed the title [WIP] Update test action steps for workflow fix: remove misplaced shebang causing CI syntax error in validate-yaml.js Jan 18, 2026
Copilot AI requested a review from huangyiirene January 18, 2026 05:13
@huangyiirene huangyiirene marked this pull request as ready for review January 18, 2026 05:23
@huangyiirene huangyiirene merged commit 03daa91 into copilot/add-mit-license-header-again Jan 18, 2026
@huangyiirene huangyiirene deleted the copilot/update-test-action-steps branch January 18, 2026 05:23
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