Enforce bash parser specification invariants in JS Copilot SDK parser#37394
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
Enforce bash parser specification on JS Copilot SDK parser
Enforce bash parser specification invariants in JS Copilot SDK parser
Jun 6, 2026
Copilot created this pull request from a session on behalf of
pelikhan
June 6, 2026 20:40
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the actions/setup JavaScript bash command parser to be stack-safe under long prefix chains and expands test coverage to enforce strict “total-function” behavior (never throw, stable []/null outputs). It also includes updates to compiled workflow/action pin artifacts.
Changes:
- Replaced recursive prefix skipping in
extractCommandNamewith an iterative scan to avoid recursion-depth failures. - Added type-contract and robustness tests ensuring all parser APIs return
[]/nullfor non-string runtime inputs and handle extreme prefix depth. - Updated generated workflow lock/pin data (including removal of an unused setup action pin and regeneration of a lock workflow file).
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/data/action_pins.json | Removes an action pin entry (generated pin data update). |
| pkg/actionpins/data/action_pins.json | Mirrors the action pin removal in the second pin dataset. |
| actions/setup/js/bash_command_parser.cjs | Makes extractCommandName iterative to avoid stack overflows on long prefix chains. |
| actions/setup/js/bash_command_parser_spec_vectors.test.cjs | Adds runtime type-contract + deep-prefix robustness tests for parser APIs. |
| .github/workflows/daily-awf-spec-compiler-surfacing.lock.yml | Regenerates a compiled workflow lock file (operational/workflow artifact update). |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 1
Comment on lines
+109
to
+118
| - name: Checkout actions folder | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| repository: github/gh-aw | ||
| sparse-checkout: | | ||
| actions | ||
| persist-credentials: false | ||
| - name: Setup Scripts | ||
| id: setup | ||
| uses: github/gh-aw-actions/setup@v0.77.5 | ||
| uses: ./actions/setup |
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.
This PR aligns the JavaScript bash parser with the parser specification used by Copilot SDK permissions, focusing on robustness and strict conformance behavior. It tightens parser guarantees so malformed or adversarial shell input remains non-throwing and semantically stable.
Parser semantics hardening
extractCommandNamewith iterative scanning for!,{, and}prefixes.Spec contract enforcement
StringLikeruntime inputs, asserting total-function behavior ([]/null, never throw).Conformance coverage expansion