Skip to content

fix: upgrade tsconfig lib/target to es2022 to resolve Array.at() TS2550 error#20849

Merged
pelikhan merged 2 commits intoclaude/configure-smoke-agent-workflowfrom
copilot/67010302120-fix-gh-actions-workflow
Mar 13, 2026
Merged

fix: upgrade tsconfig lib/target to es2022 to resolve Array.at() TS2550 error#20849
pelikhan merged 2 commits intoclaude/configure-smoke-agent-workflowfrom
copilot/67010302120-fix-gh-actions-workflow

Conversation

Copy link
Contributor

Copilot AI commented Mar 13, 2026

The js CI job was failing because resolve_host_repo.cjs uses Array.prototype.at(-1) (ES2022+), but tsconfig.json specified lib: ["es2020"], causing error TS2550: Property 'at' does not exist on type 'string[]'.

Changes

  • tsconfig.json: Bumped target and lib from es2020es2022, consistent with tsconfig.build.json which already targets ES2022
  • resolve_host_repo.cjs: Synced with main — adds targetRepoName output (repo name without owner prefix) used by actions/create-github-app-token
  • resolve_host_repo.test.cjs: Synced with main — adds 3 test cases covering target_repo_name output for cross-repo, same-repo, and fallback scenarios

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/repos/github/gh-aw/contents/.github%2Fworkflows%2Faudit-workflows.md
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/dist/workers/forks.js --quiet e_modules/.bin/g--verify git bran�� -M main e/git-upload-pack tions/setup/nodenode h it git (http block)

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

Original prompt

Fix the failing GitHub Actions workflow js
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 67010302120
Job URL: https://github.com/github/gh-aw/actions/runs/23067762888/job/67010302120


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…rray.at()

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] [67010302120] Fix the failing GitHub Actions workflow fix: upgrade tsconfig lib/target to es2022 to resolve Array.at() TS2550 error Mar 13, 2026
Copilot AI requested a review from lpcox March 13, 2026 20:28
@pelikhan pelikhan marked this pull request as ready for review March 13, 2026 20:29
Copilot AI review requested due to automatic review settings March 13, 2026 20:29
@pelikhan pelikhan merged commit 4342f79 into claude/configure-smoke-agent-workflow Mar 13, 2026
103 checks passed
@pelikhan pelikhan deleted the copilot/67010302120-fix-gh-actions-workflow branch March 13, 2026 20:29
Copy link
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

Updates the JS action TypeScript configuration to ES2022 to fix CI typechecking failures (TS2550 on Array.prototype.at) and syncs the host-repo resolver script/tests with main by adding a new output used by downstream steps.

Changes:

  • Bumped actions/setup/js/tsconfig.json target/lib from es2020 to es2022 to align with ES2022 runtime usage (Array.at()).
  • Added a target_repo_name output to resolve_host_repo.cjs (repo name without owner prefix).
  • Added/updated tests to cover target_repo_name output behavior across invocation scenarios.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
actions/setup/js/tsconfig.json Moves TS target/lib to ES2022 so Array.at() is type-safe under checkJs.
actions/setup/js/resolve_host_repo.cjs Emits target_repo_name derived from target_repo for consumers needing repo-only names.
actions/setup/js/resolve_host_repo.test.cjs Adds coverage for the new target_repo_name output across cross-repo/same-repo/fallback cases.

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

You can also share your feedback on Copilot code review. Take the survey.

lpcox added a commit that referenced this pull request Mar 13, 2026
…repos (#20830)

* Initial plan

* Plan: Configure smoke-agent workflow with guard policies

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

* Configure smoke-agent workflow with guard policies for public repos

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

* Use local GitHub MCP container instead of remote mode

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

* fix: add 3 missing action pins entries to resolve TestGetActionPinsSorting failure (#20831)

* Initial plan

* fix: add 3 missing action pins to fix TestGetActionPinsSorting test failure

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

* Fix: Generate write-sink with accept:* for repos='public'/'all'

When repos is set to "public" or "all", the renderer now creates a
write-sink configuration with accept: ["*"] instead of returning nil.
This ensures safe outputs work correctly with guard policies.

Changes:
- Updated deriveSafeOutputsGuardPolicyFromGitHub() to return accept:["*"]
- Updated test cases to expect accept:["*"] for repos="all" and repos="public"
- Updated documentation and specification to reflect new behavior
- Verified smoke-agent workflow compiles with correct guard-policies

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

* Update PR title and description

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

* fix: add 3 missing action pins to resolve TestGetActionPinsSorting failure (#20837)

* Initial plan

* fix: add 3 missing action pin entries to resolve TestGetActionPinsSorting failure

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

* updated mcpg version

* [WIP] [67003058781] Fix the failing GitHub Actions workflow test (#20838)

* Initial plan

* fix: make TestGetActionPinsSorting resilient to JSON pin count changes

Instead of hardcoding the expected pin count (34), the test now dynamically
derives the expected count by parsing actionPinsJSON directly. This ensures:
- The test always validates that getActionPins() returns all entries from JSON
- No manual count updates needed when new pins are added
- Resilient to Go test cache issues where stale binaries could cause failures

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

* feat: add guard policy smoke test matrix

Rename smoke-agent to smoke-agent-public-approved to reflect its
guard policy params, and add four new workflows to test different
repos scope × min-integrity combinations:

- all/none: most permissive, all repos, no integrity requirement
- all/merged: most restrictive, all repos, merged content only
- scoped/approved: explicit repo patterns (github/gh-aw, github/*), approved
- public/none: public repos only, no integrity requirement

Each workflow exercises search_repositories, list_issues, and
search_code to test guard policy filtering effectiveness, then
aggregates results into a safe-outputs PR comment.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: upgrade tsconfig lib/target to es2022 to resolve Array.at() TS2550 error (#20849)

* Initial plan

* fix: upgrade tsconfig target/lib to es2022 to fix TS2550 error with Array.at()

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

* Fix two failing JS tests: call_workflow empty allowlist and create_discussion fallback note (#20852)

* Initial plan

* Initial plan: fix two failing JS tests

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

* Fix two failing JS tests: call_workflow empty allowlist and create_discussion fallback note

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

---------

Co-authored-by: anthropic-code-agent[bot] <242468646+Claude@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Landon Cox <landon.cox@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

4 participants