Skip to content

Run PowerShell steps when pwsh is missing - #693

Merged
sj26 merged 3 commits into
mainfrom
fix/powershell-runtime
Nov 23, 2026
Merged

sj26 merged 3 commits into
mainfrom
fix/powershell-runtime

Conversation

@sj26

@sj26 sj26 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

🤖

Why

GitHub-hosted Ubuntu images include PowerShell, but an execution image without pwsh fails before this step can run:

- shell: pwsh
  run: Write-Output 'Hello from PowerShell'
exec: "pwsh": executable file not found in $PATH

What

Run the step by installing pinned PowerShell 7.6.9 only when the requested host pwsh executable is missing from the step's PATH. Verify the official archive's SHA-256 before extraction, keep the installation private to the job, and expose it to nested commands and later steps. Leave existing installations unchanged.

Installer subprocesses use the restricted runtime environment instead of inheriting agent credentials. This credential boundary needs human review before merge.

This also covers composite steps and the Windows default shell. Job containers, explicit executable paths, legacy powershell, and native OS libraries remain the image author's responsibility. Installation failures name the requested shell and suggest checking installation, PATH, and permissions; they never substitute another shell.

Add Linux and Windows hosted smoke coverage for execution without a setup action, Unicode environment values, outputs, terminating errors, and nested pwsh commands.

Install a checksum-verified, job-private PowerShell runtime on demand. Preserve existing installations and cover Linux and Windows with hosted smoke tests.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ed4d-8aac-72b8-8961-b8b102553e4c
Co-authored-by: Amp <amp@ampcode.com>

@buildsworth-bk-app buildsworth-bk-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One composite PATH propagation issue needs fixing before merge.

Want to dig deeper?

Paste this into your agent to explore the findings from this review's Buildkite build:

Download the buildsworth logs from build 56996, then answer my questions about the findings.

Use the reading-buildsworth-logs skill to run this.

About buildsworth

Model: gpt-6.1-sol with xhigh thinking.

How to request a review: Comment @buildsworth-bk review on the PR, or request buildsworth-bk as a reviewer.

Risk labels — buildsworth classifies risk itself from the diff. The same approval policy applies in every repository:

  • L1 — Low risk (dep bumps, docs/copy, lockfiles, small presentational fixes). buildsworth may approve by default.
  • L2 — Standard risk (new UI, additive API fields, refactors). buildsworth may approve without per-PR permission.
  • L3 — High risk (auth, migrations, payments, secrets, perf-critical pipeline paths). Human approval required; buildsworth never approves.

Comment thread internal/runtime/shell_execution.go Resolved
Propagate the effective PATH within a composite while retaining the separate job PATH delta, so invocation-local PATH values do not leak.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ed4d-8aac-72b8-8961-b8b102553e4c
Co-authored-by: Amp <amp@ampcode.com>

sj26 commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

🤖 @buildsworth-bk review

@buildsworth-bk-app buildsworth-bk-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The composite PATH fix addresses the previous blocker. One installer credential-exposure issue needs fixing before merge; this credential boundary also requires human review.

Want to dig deeper?

Paste this into your agent to explore the findings from this review's Buildkite build:

Download the buildsworth logs from build 57001, then answer my questions about the findings.

Use the reading-buildsworth-logs skill to run this.

Comment thread internal/cli/runtime_powershell.go Resolved
@buildsworth-bk-app
buildsworth-bk-app Bot dismissed their stale review November 23, 2026 08:29

Superseded by a newer Buildsworth review.

Default captured tools to the restricted runtime environment. Exercise a PATH-provided extractor and the installed version command with a dummy agent token.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ed4d-8aac-72b8-8961-b8b102553e4c
Co-authored-by: Amp <amp@ampcode.com>

sj26 commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

🤖 @buildsworth-bk review

@buildsworth-bk-app buildsworth-bk-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The installer credential-exposure fix addresses the remaining blocker; no new findings. Human approval is still required for the new installer execution and credential boundary.

Want to dig deeper?

Paste this into your agent to explore the findings from this review's Buildkite build:

Download the buildsworth logs from build 57004, then answer my questions about the findings.

Use the reading-buildsworth-logs skill to run this.

@buildsworth-bk-app
buildsworth-bk-app Bot dismissed their stale review November 23, 2026 08:37

Superseded by a newer Buildsworth review.

@sj26
sj26 merged commit cc0af40 into main Nov 23, 2026
8 checks passed
@sj26
sj26 deleted the fix/powershell-runtime branch November 23, 2026 09:53
@buildkite-gha-releases

Copy link
Copy Markdown

🤖 Released in v0.138.0

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