Skip to content

fix: prevent JS replace() special patterns from corrupting rendered prompts#30461

Merged
pelikhan merged 4 commits into
mainfrom
copilot/fix-replace-special-patterns
May 5, 2026
Merged

fix: prevent JS replace() special patterns from corrupting rendered prompts#30461
pelikhan merged 4 commits into
mainfrom
copilot/fix-replace-special-patterns

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 5, 2026

String.prototype.replace() interprets certain sequences in the replacement string as special patterns ($$, $&, $`, $', $n). When untrusted file content (e.g. from {{#runtime-import}}) or GitHub event data is used directly as the replacement argument, these patterns silently corrupt the rendered prompt.

Changes

  • interpolate_prompt.cjs — two call sites:

    • interpolateVariables(): result.replace(pattern, value)result.replace(pattern, () => value)
    • Experiment condition substitution: template-literal replacement with $1 capture reference → replacer function (_, prefix) => prefix + value
  • runtime_import.cjs — two call sites in processRuntimeImports():

    • Cache-hit and fresh-import paths both switch to () => content replacer
  • interpolate_prompt.test.cjs — regression tests for all five special patterns ($$, $&, $`, $', $1) in interpolated variable values, plus STEP 2.5 integration tests that set GH_AW_EXPERIMENTS_* env vars to values containing $1 and $& and verify condition evaluation is not corrupted (using an extracted applyExperimentSubstitution helper)

  • runtime_import.test.cjs — regression tests covering all five special patterns in imported file content, verifying both the fresh-import and cache-hit code paths in processRuntimeImports()

…ing prompts

String.prototype.replace() treats certain character sequences in the
replacement string as special patterns ($&, $`, $', $$, $n). When
untrusted content from a repository (e.g. file contents pulled in via
{{#runtime-import}}) is used as a replacement string directly, those
special patterns corrupt the rendered prompt.

Fix by switching all affected .replace(pattern, value) calls to use
a replacer function .replace(pattern, () => value) which bypasses
special pattern interpretation.

Affected locations:
- interpolate_prompt.cjs: interpolateVariables() and experiment
  placeholder substitution in conditions
- runtime_import.cjs: cached import and fresh import replacements

Adds regression tests for $$, $&, $`, $', and $1 patterns in values."

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/bef4c406-66fd-4e91-8901-866a342c32f4

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix String.prototype.replace() handling of special patterns fix: prevent JS replace() special patterns from corrupting rendered prompts May 5, 2026
Copilot AI requested a review from pelikhan May 5, 2026 22:38
@pelikhan pelikhan marked this pull request as ready for review May 5, 2026 22:40
Copilot AI review requested due to automatic review settings May 5, 2026 22:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents JavaScript String.prototype.replace() replacement-string special patterns ($$, $&, $` , $', $n) from corrupting rendered prompts when interpolated values or runtime-imported file content contain those sequences.

Changes:

  • Switch variable interpolation and runtime-import substitutions to use function replacers (() => value/content) to bypass replacement-string pattern expansion.
  • Update experiment-condition substitution to use a replacer callback instead of $1... replacement strings.
  • Add regression tests ensuring interpolated variable values containing the special $ patterns are preserved.
Show a summary per file
File Description
actions/setup/js/interpolate_prompt.cjs Uses replacer functions for variable interpolation and experiment-condition substitution to avoid $ replacement pattern expansion.
actions/setup/js/runtime_import.cjs Uses replacer functions when inserting imported (and cached) content to prevent $ pattern expansion corrupting output.
actions/setup/js/interpolate_prompt.test.cjs Adds regression tests covering $ special patterns in interpolated variable values.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 2

Comment on lines 1127 to 1131
// Reuse cached content
const cachedContent = importCache.get(filepathWithRange);
if (cachedContent !== undefined) {
processedContent = processedContent.replace(fullMatch, cachedContent);
processedContent = processedContent.replace(fullMatch, () => cachedContent);
core.info(`Reusing cached content for ${filepathWithRange}`);
Comment on lines 298 to 302
const conditionPattern = new RegExp(`(\\{\\{#if[^}]*?)${exprForm.replace(".", "\\.")}`, "gi");
if (conditionPattern.test(content)) {
conditionPattern.lastIndex = 0;
content = content.replace(conditionPattern, `$1${value || ""}`);
content = content.replace(conditionPattern, (_, prefix) => prefix + (value || ""));
core.info(` Substituted ${exprForm} in conditions → "${value || ""}"`);
@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented May 5, 2026

@copilot Review all comments

Copilot AI and others added 2 commits May 5, 2026 23:17
…and experiment conditions

- runtime_import.test.cjs: add 7 tests covering $$, $&, $`, $', $1 patterns in
  freshly-imported and cached content (both code paths in processRuntimeImports)
- interpolate_prompt.test.cjs: add 2 tests for STEP 2.5 experiment placeholder
  condition substitution with $1 and $& values; tests set GH_AW_EXPERIMENTS_*
  env vars and apply the substitution logic directly through renderMarkdownTemplate"

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/f77dcfcd-e644-4140-a126-f79bf8ef0d13

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 5, 2026

@copilot Review all comments

Added the requested tests in commit 530561b:

  • runtime_import.test.cjs: 7 regression tests covering all five special patterns ($$, $&, $`, $', $1) in imported file content, including both the fresh-import path and the cache-hit path (two files imported twice to exercise the cache).

  • interpolate_prompt.test.cjs: 2 STEP 2.5 integration tests that set GH_AW_EXPERIMENTS_STYLE to $1bold and $&matched respectively, apply the exact experiment condition substitution logic from main() via an extracted applyExperimentSubstitution helper (avoiding duplication), then verify renderMarkdownTemplate selects the correct branch.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
    • Triggering command: /usr/bin/gh gh repo view --json owner,name --jq .owner.login &#43; &#34;/&#34; &#43; .name /opt/hostedtoolcache/node/24.14.1/x64/bin/node (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw interpolate_promrev-parse erignore ache/go/1.25.8/x64/pkg/tool/linu--jq --no�� 1614-7581/test-822535998 (http block)
  • https://api.github.com/orgs/test-owner/actions/secrets
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name h ../../../.prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name h ../../../.prettierignore git bject.type] | @tsv --show-toplevel gh /usr/bin/git git rev-�� w/js/**/*.json&#39; --ignore-path git /usr/bin/git --show-toplevel git /usr/bin/gh git (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq [.object.sha, .object.type] | @tsv --show-toplevel node /usr/bin/git sistency_Inlinedgit scripts/**/*.js /bin/sh git rev-�� --show-toplevel /bin/sh /usr/bin/git licyBlockedUsersgh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq [.object.sha, .object.type] | @tsv /ref/tags/v9 sh sv /v3.0.0 git sv git rev-�� --show-toplevel node /usr/bin/git licyMinIntegritygh ../../../**/*.jsapi /usr/bin/git git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv add origin /usr/bin/git lic_226168993/00gh committer.name x86_64/node git rev-�� /ref/tags/v9 git sv ource-field-varigit (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv git test@example.com /usr/bin/git repo1583968920/0gh git p/bin/git git remo�� 3473661911 other bject.type] | @tsv files...&#34; git de_modules/.bin/--show-toplevel git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv 1614-7581/test-3978037776/.github/workflows (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel git-upload-pack /usr/bin/git -stringintconv -tests /usr/bin/gh git rev-�� --show-toplevel gh /usr/bin/git /repos/actions/ggit --jq /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel gh /usr/bin/infocmp /repos/actions/ggit --jq /usr/bin/gh infocmp -1 xterm-color gh /usr/bin/git /repos/actions/ggit --jq /usr/bin/infocmp--show-toplevel git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv -x c /usr/bin/git - (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv /tmp/TestHashStability_SameInputSameOutput3255518046/001/stability-test.md (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv --get remote.origin.url /opt/hostedtoolcache/node/24.14.1/x64/bin/node (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/git --get remote.origin.urrev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git /ref/tags/v9 Initial commit sv git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv /repos/actions/setup-node/git/ref/tags/v4 --jq /usr/bin/git bject.type] | @tgit infocmp /usr/bin/infocmp--show-toplevel git rev-�� --show-toplevel infocmp /usr/bin/git xterm-color git /usr/bin/git git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv ignore-path ../../../.prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv tions-lock.json pkg/actionpins/data/action_pins.json; \ cp .github/aw/actions-lock.json pkg/wornode (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9.0.0
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9.0.0 --jq [.object.sha, .object.type] | @tsv ignore-path ../../../.prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9.0.0 --jq [.object.sha, .object.type] | @tsv (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9.0.0 --jq [.object.sha, .object.type] | @tsv js/**/*.json&#39; ---errorsas tions/setup/js/i-ifaceassert 64/bin/bash (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv /repos/actions/github-script/git/ref/tags/v9 --jq /usr/bin/git Onlyrepos_only_wgh on 1/x64/bin/node git rev-�� --show-toplevel 1/x64/bin/node /usr/bin/git == &#39;true&#39; (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel sh /usr/bin/git ithub/workflows/gh on ache/node/24.14./repos/actions/github-script/git/ref/tags/v9 git rev-�� --show-toplevel sh /usr/bin/git sistency_GoAndJagit gh ache/node/24.14.--show-toplevel git (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv /ref/tags/v9 bash sv Onlyrepos_only_winfocmp on (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/git /tmp/gh-aw-test-git remote /usr/bin/git git rev-�� /ref/tags/v9 git sv /tmp/compile-insinfocmp rev-parse /usr/bin/gh infocmp (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv licyTrustedUsersExpressionCompiledOutput3411473715/001 -buildtags /usr/bin/git l -ifaceassert -nilfunc git rev-�� --show-toplevel s /usr/bin/git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv /tmp/gh-aw-test-runs/20260505-231614-7581/test-1test-logs/run-12346 url /opt/hostedtoolcache/node/24.14.1/x64/bin/node remote.origin.urgit (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv /home/REDACTED/work/gh-aw/gh-aw/.github/workflows resolved$ /usr/bin/git --get-regexp --local bash git remo�� add origin 0&#34;}} 43769286/001 43769286/002/worrev-parse cal/bin/bash infocmp (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv runs/20260505-231900-19973/test-1514107294 git /usr/bin/git s/test.md pecial $ patternrev-parse (http block)
  • https://api.github.com/repos/aws-actions/configure-aws-credentials/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/aws-actions/configure-aws-credentials/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/git /tmp/gh-aw-test-git remote /usr/bin/infocmp--show-toplevel git rev-�� --show-toplevel infocmp /usr/bin/infocmp /ref/tags/v9 (http block)
    • Triggering command: /usr/bin/gh gh api /repos/aws-actions/configure-aws-credentials/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/git /ref/tags/v9 remote sv git rev-�� --show-toplevel git /usr/bin/gh --show-toplevel (http block)
    • Triggering command: /usr/bin/gh gh api /repos/aws-actions/configure-aws-credentials/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git rev-�� --show-toplevel git /usr/bin/gh --show-toplevel git e/git gh (http block)
  • https://api.github.com/repos/azure/login/git/ref/tags/v2
    • Triggering command: /usr/bin/gh gh api /repos/azure/login/git/ref/tags/v2 --jq [.object.sha, .object.type] | @tsv --show-toplevel node /usr/bin/git ons-test22978567git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/azure/login/git/ref/tags/v2 --jq [.object.sha, .object.type] | @tsv --show-toplevel gh /usr/bin/git /repos/actions/ggit l /opt/hostedtoolc--show-toplevel git rev-�� --show-toplevel node /usr/bin/infocmp /home/REDACTED/worinfocmp git /usr/bin/git infocmp (http block)
  • https://api.github.com/repos/docker/login-action/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/docker/login-action/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv --show-toplevel gh /usr/bin/git /repos/actions/ggit --jq /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/login-action/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/git /tmp/gh-aw-test-git l (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq [.object.sha, .object.type] | @tsv --show-toplevel node /usr/bin/git ithub/workflows/gh --reporter=verboapi ache/node/24.14./repos/actions/github-script/git/ref/tags/v9 git rev-�� --show-toplevel /opt/hostedtoolc^remote\..*\.gh-resolved$ /usr/bin/git sistency_GoAndJainfocmp (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq [.object.sha, .object.type] | @tsv --show-toplevel sh /usr/bin/git 1900-19973/test-infocmp git ache/go/1.25.8/xxterm-color git rev-�� --show-toplevel ache/go/1.25.8/x64/pkg/tool/linuremote.origin.url /usr/bin/git log.showsignaturinfocmp log /home/REDACTED/worxterm-color git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv /home/REDACTED/work/gh-aw/gh-aw/.github/workflows l /usr/bin/git assword=$GITHUB_git assword=$GITHUB_rev-parse x86_64/node git init�� /usr/bin/infocmp/home/REDACTED/work/gh-aw/gh-aw/.github/workflows/ab-testing-advisor.md git /usr/bin/git lGitcustom_brancgit lGitcustom_brancrev-parse odules/npm/node_--show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv /ref/tags/v9 s/test.md sv iant-2043867602/git git erns git remo�� bject.type] | @t/tmp/gh-aw-test-runs/20260505-231900-19973/test-2549782072/.github/workflows git /usr/bin/git --show-toplevel infocmp layTitle git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --limit 100 --created &gt;=2026-04-28 (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --limit 100 --created &gt;=2026-04-05 (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --limit 100 --created &gt;=2026-02-04 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name git /opt/hostedtoolcache/uv/0.11.10/x86_64/sh --show-current git /usr/bin/gh sh -c 1900-19973/test-936257482/.github/workflows gh /usr/local/sbin/sh /repos/actions/ggit --jq run-script/lib/node-gyp-bin/sh sh (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name nux-x86_64 .cfg ithub-script/gitgit --jq bject.type] | @t--show-toplevel erignore --no�� 1900-19973/test-93195676/.github/workflows infocmp ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet ithub-script/gitgit git bject.type] | @t--show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1234567890
    • Triggering command: /usr/bin/gh gh api repos/{owner}/{repo}/actions/runs/1234567890 --jq {databaseId: .id, number: .run_number, url: .html_url, status: .status, conclusion: .conclusion, workflowName: .name, workflowPath: .path, createdAt: .created_at, startedAt: .run_started_at, updatedAt: .updated_at, event: .event, headBranch: .head_branch, h ../../../.pret.prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api repos/{owner}/{repo}/actions/runs/1234567890 --jq {databaseId: .id, number: .run_number, url: .html_url, status: .status, conclusion: .conclusion, workflowName: .name, workflowPath: .path, createdAt: .created_at, startedAt: .run_started_at, updatedAt: .updated_at, event: .event, headBranch: .head_branch, h ../../../.pret.prettierignore --jq /usr/bin/git ithub-script/git/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet git bject.type] | @tsv git rev-�� json&#39; --ignore-path ../../../.pr**/*.json git ules/.bin/node --show-toplevel git /usr/bin/gh git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name git .cfg /ref/tags/v9 git sv erignore ache�� 1900-19973/test-93195676/.github/workflows gh ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /repos/actions/ggit --jq /usr/bin/infocmp--show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name mkdir k/gh-aw/gh-aw/actions/setup/js/node_modules/.bin/node /tmp/gh-aw git /usr/bin/git sh ache�� npx prettier --write &#39;**/*.cjs&#39; &#39;**/*.ts&#39; &#39;**/*.json&#39; --ignore-path ../../../.pr**/*.json git on rkflow/js/**/*.jgit git erignore sh (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name git k/gh-aw/gh-aw/actions/setup/node_modules/.bin/node HEAD git /usr/bin/gh sh ache�� npx prettier --write &#39;**/*.cjs&#39; &#39;**/*.ts&#39; &#39;**/*.remote.origin.url gh 1/x64/bin/node rkflow/js/**/*.jgit --jq erignore 1/x64/bin/node (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 run 1/x64/bin/node interpolate_promgit (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name DefaultBranchFromLsRemoteWithRealGitmain_branch2530382738/001&#39; /home/REDACTED/.local/bin/sh --oneline -10 /usr/bin/infocmp--get sh -c 1900-19973/test-936257482/.github/workflows infocmp /usr/local/bin/sh xterm-color git /usr/bin/git sh (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name git ache/node/24.14.1/x64/bin/npx ithub-script/gitgit git bject.type] | @tsv sh -c 1900-19973/test-936257482/.github/workflows on 1/x64/bin/node /ref/tags/v9 erignore sv 1/x64/bin/node (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path h ../../../.prettierignore (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 (http block)
  • https://api.github.com/repos/github/gh-aw/contents/.github/workflows/shared/reporting.md
    • Triggering command: /tmp/go-build3561008415/b404/cli.test /tmp/go-build3561008415/b404/cli.test -test.testlogfile=/tmp/go-build3561008415/b404/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true (http block)
    • Triggering command: /tmp/go-build2188984704/b404/cli.test /tmp/go-build2188984704/b404/cli.test -test.testlogfile=/tmp/go-build2188984704/b404/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true --show-toplevel git /usr/bin/git git rev-�� --show-toplevel git modules/@npmcli/run-script/lib/node-gyp-bin/node /ref/tags/v9 git sv run-parts (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.47.4
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq [.object.sha, .object.type] | @tsv --show-toplevel e/git /usr/bin/git /tmp/TestGuardPodu rev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git /tmp/gh-aw-test-git show .test git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq [.object.sha, .object.type] | @tsv --show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv interpolate_prompt.test.cjs --local x_amd64/compile se pt (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv th .prettierignore --log-level=error pecial $ patterns in runtime imports and experim-U0 x86_64/git ithub-script/gitinfocmp git bject.type] | @txterm-color infocmp -1 lGitmain_branch2530382738/001&#39; lGitmain_branch2530382738/001&#39; /usr/bin/git --show-toplevel git /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv ant-409229887/.github/workflows --local /opt/hostedtoolcache/go/1.25.8/x64/bin/git credential.userngit (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv 785ba509:actions/setup/js/interpolate_prompt.test.cjs git /usr/bin/git --show-toplevel git /usr/bin/gh git rev-�� /workflows gh x_amd64/vet /repos/actions/ggit --jq /usr/bin/gh x_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v2.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv ace-special-patterns^{commit} --local 1/x64/bin/npx credential.usernnode (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv json&#39; --ignore-path ../../../.pr**/*.json --local tions/setup/js/node_modules/.bin../../../.prettierignore user.name (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv json&#39; --ignore-path ../../../.pr**/*.json --local tions/node_modules/.bin/sh user.name (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v3.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq [.object.sha, .object.type] | @tsv json&#39; --ignore-p--exclude-hidden=receive --local cal/bin/bash user.name (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq [.object.sha, .object.type] | @tsv on&#39; --ignore-path ../../../.prettierignore git odules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/sh ithub-script/gitgit gh ker/docker-init git 1/x6�� ub/workflows ker/docker-init x_amd64/vet xterm-color sh /usr/bin/git x_amd64/vet (http block)
  • https://api.github.com/repos/google-github-actions/auth/git/ref/tags/v2
    • Triggering command: /usr/bin/gh gh api /repos/google-github-actions/auth/git/ref/tags/v2 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/git --show-toplevel (http block)
    • Triggering command: /usr/bin/gh gh api /repos/google-github-actions/auth/git/ref/tags/v2 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/git /tmp/gh-aw-test-git rev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git user.email test@example.comrev-parse /usr/bin/git git (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq [.object.sha, .object.type] | @tsv interpolate_prompt.test.cjs credential.username x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq [.object.sha, .object.type] | @tsv iant-3345054702 pecial $ patterns in runtime imp**/*.json /usr/bin/gh --show-toplevel git ache/uv/0.11.10/--get-regexp gh api on&#39; --ignore-path ../../../.prettierignore --jq /usr/bin/git --show-toplevel 57698b00..HEAD /usr/bin/git git (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion sTruthy } = requgit (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion ithub-script/gitgit --jq bject.type] | @t--show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet hash�� ithub/workflows/architecture-guardian.md **/*.cjs /home/REDACTED/work/gh-aw/node_modules/.bin/node **/*.json --ignore-path ../../../.prettilist node (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo ode (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo n-dir/node (http block)
    • Triggering command: /usr/bin/gh gh workflow list --repo owner/repo --json name,path,state r: $owner, name: $name) { hasDiscussionsEnabled } } -n1 --format=format:-1 --end-of-optionsxterm-color e/git /hom�� mplied **/*.cjs /opt/hostedtoolcache/node/24.14.1/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/n--show-toplevel **/*.json set ../../../.pretti--show-toplevel sh (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name h ../../../.prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name h ../../../.prettierignore --jq modules/@npmcli/run-script/lib/node-gyp-bin/sh /ref/tags/v9 infocmp sv git rev-�� w/js/**/*.json&#39; --ignore-path git /usr/bin/git --show-toplevel git /usr/bin/git git (http block)
  • https://api.github.com/repos/test/repo
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch &#34;prettier&#34; --write &#39;scripts/**/*.js&#39; --ignore-path .prettierignore --log-level=e!../../../pkg/wogh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch --show-toplevel infocmp /usr/bin/git /ref/tags/v9 s in runtime imprev-parse sv git rev-�� --show-toplevel gh /usr/bin/git h ../../../.pretgit k modules/@npmcli/--show-toplevel git (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@pelikhan pelikhan merged commit 5e019d6 into main May 5, 2026
@pelikhan pelikhan deleted the copilot/fix-replace-special-patterns branch May 5, 2026 23:28
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.

Bug: String.prototype.replace() special replacement patterns corrupt rendered prompts

3 participants