fix(ci): prevent JS syntax error when workflow dispatch inputs contain special characters#1029
Conversation
propagate
…n special characters The weekly promotion workflow injected user-controlled and job-output values directly into JavaScript string literals inside github-script steps. Any apostrophe in those values (e.g. "didn't run as scheduled") would terminate the string literal early, producing a SyntaxError that aborted the entire promotion job. Move all three affected values to the step-level env: block and read them via process.env.* in the script body. This ensures values are delivered as runtime environment variables and never evaluated as JavaScript source code, regardless of their content. Three inputs secured: - inputs.skip_workflow_check (check-nightly-health job) - inputs.reason (create-promotion-pr job, Create Promotion PR step) - needs.check-nightly-health.outputs.failure_reason and .latest_run_url (notify-on-failure job, Create Failure Issue step) Fixes #1022
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the weekly nightly promotion workflow against JavaScript parse failures caused by special characters in workflow dispatch inputs.
Changes:
- Moves affected workflow values into step-level environment variables before reading them in
github-script. - Adds/updates QA and planning documentation for issue #1022.
- Adds a manual validation plan for the workflow dispatch regression.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/weekly-nightly-promotion.yml |
Passes dispatch inputs and dynamic outputs through env before JavaScript use. |
docs/issues/issue-1022-manual-test-plan.md |
Adds manual regression scenarios for special-character dispatch reasons. |
docs/plans/current_spec.md |
Replaces the active spec with the issue #1022 workflow injection plan. |
docs/reports/qa_report.md |
Replaces the QA report with the final audit for this workflow fix. |
docs/reports/qa_report_2026-05-19_issue1022.md |
Adds an earlier audit report for issue #1022. |
Contributor
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Contributor
✅ Supply Chain Verification Results✅ PASSED 📦 SBOM Summary
🔍 Vulnerability Scan
📎 Artifacts
Generated by Supply Chain Verification workflow • View Details |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Fixes a
SyntaxError: Unexpected identifier 't'that aborted the weekly nightly promotion workflow when manually triggered with a reason containing an apostrophe (e.g."didn't run as scheduled").Root Cause
GitHub Actions substitutes
${{ }}expressions before the JavaScript source is parsed. User-controlled and job-output values were interpolated directly into single-quoted JS string literals insidegithub-scriptsteps. Any apostrophe in those values terminated the string early, causing a parse error that killed the entire job.Fix
All affected values are moved to the step-level
env:block and read viaprocess.env.*in the script body. Values are delivered as runtime environment variables and never evaluated as JavaScript source code.Three injection points secured:
inputs.skip_workflow_check—check-nightly-healthjobinputs.reason—create-promotion-prjob,Create Promotion PRstepneeds.check-nightly-health.outputs.failure_reason+.latest_run_url—notify-on-failurejob,Create Failure IssuestepValidation
yamllint: ✅ no errorsactionlint: ✅ no errorsinputs.*values in JS string literalsTesting
Manual test plan:
docs/issues/issue-1022-manual-test-plan.mdTo verify: manually trigger
weekly-nightly-promotion.ymlwith reason"didn't run as scheduled"— the job should complete without aSyntaxError.Fixes #1022