[GH-ISSUE #467] Doesn't correctly handle worker-level Powershell script runs #325

Closed
opened 2026-03-01 21:42:23 +03:00 by kerem · 4 comments
Owner

Originally created by @JustinGrote on GitHub (Jan 11, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/467

Issue

Powershell 7 scripts do not run in native workers via run: step, and report a false positive of succeeding

Steps to Reproduce

With the following simple config:

name: Test
on:
  push:
  pull_request:
    branches:
      - main

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - shell: pwsh
        run: |
          "this should work!"
          "Evidence" > /github/workspace/worked

and swapping in the official powershell worker (and using -r so the container doesn't disappear):
act -rvP ubuntu-latest=mcr.microsoft.com/powershell:lts-ubuntu-18.04
The result says success:
image

However upon inspecting the image via attaching a shell to the docker container the "evidence" file was not created:
image

And running the command manually in the container from shell shows an exec problem
image

Running the command using the -f format works fine however
image
image

Originally created by @JustinGrote on GitHub (Jan 11, 2021). Original GitHub issue: https://github.com/nektos/act/issues/467 ### Issue Powershell 7 scripts do not run in native workers via `run:` step, and report a false positive of succeeding ### Steps to Reproduce With the following simple config: ```yaml name: Test on: push: pull_request: branches: - main jobs: test: runs-on: ubuntu-latest steps: - shell: pwsh run: | "this should work!" "Evidence" > /github/workspace/worked ``` and swapping in the official powershell worker (and using -r so the container doesn't disappear): `act -rvP ubuntu-latest=mcr.microsoft.com/powershell:lts-ubuntu-18.04` The result says success: ![image](https://user-images.githubusercontent.com/15258962/104225876-d1ff5380-53fb-11eb-8412-4262edaa3b40.png) However upon inspecting the image via attaching a shell to the docker container the "evidence" file was not created: ![image](https://user-images.githubusercontent.com/15258962/104225778-abd9b380-53fb-11eb-912f-db984aa471c9.png) And running the command manually in the container from shell shows an exec problem ![image](https://user-images.githubusercontent.com/15258962/104226011-01ae5b80-53fc-11eb-8b36-132629b47f58.png) Running the command using the `-f` format works fine however ![image](https://user-images.githubusercontent.com/15258962/104226117-24d90b00-53fc-11eb-9fe2-76bb7ba4aa21.png) ![image](https://user-images.githubusercontent.com/15258962/104226128-2a365580-53fc-11eb-92ef-2b2b0c714c22.png)
kerem closed this issue 2026-03-01 21:42:24 +03:00
Author
Owner

@karolswdev commented on GitHub (Jan 19, 2021):

I confirm that this is not working currently. I encountered this issue with a similar flow.

I use karolczajkowski/dotnet-ubuntu-dind image with pre-installed pwsh. Same thing happens whenever I run steps which use the shell token.

<!-- gh-comment-id:763010911 --> @karolswdev commented on GitHub (Jan 19, 2021): I confirm that this is not working currently. I encountered this issue with a similar flow. I use ``karolczajkowski/dotnet-ubuntu-dind`` image with pre-installed pwsh. Same thing happens whenever I run steps which use the ``shell`` token.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 19, 2021):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:781725383 --> @github-actions[bot] commented on GitHub (Feb 19, 2021): Issue is stale and will be closed in 14 days unless there is new activity
Author
Owner

@JustinGrote commented on GitHub (Mar 5, 2021):

@cplee this is still an issue, I forgot to bump it active, can you reopen?

<!-- gh-comment-id:791054980 --> @JustinGrote commented on GitHub (Mar 5, 2021): @cplee this is still an issue, I forgot to bump it active, can you reopen?
Author
Owner

@JustinGrote commented on GitHub (Mar 24, 2021):

After extensive debugging I found the issue, when the command is built, the space splitting in the array does not split it correctly, the powershell command should all be on one line
image

I'll fix this in the PR, this is also why the -f method worked

<!-- gh-comment-id:805476722 --> @JustinGrote commented on GitHub (Mar 24, 2021): After extensive debugging I found the issue, when the command is built, the space splitting in the array does not split it correctly, the powershell command should all be on one line ![image](https://user-images.githubusercontent.com/15258962/112254424-d1fea980-8c1d-11eb-84ea-919ccfd48ba8.png) I'll fix this in the PR, this is also why the -f method worked
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#325
No description provided.