mirror of
https://github.com/nektos/act.git
synced 2026-04-26 01:15:51 +03:00
[GH-ISSUE #2545] PowerShell steps load profile during execution #1166
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#1166
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @HeyItsGilbert on GitHub (Nov 26, 2024).
Original GitHub issue: https://github.com/nektos/act/issues/2545
Expected Behavior
Running a PowerShell script or command should run in it's own process without a profile being loaded.
Current Behavior
Currently the invocation runs
powershell.exe -command . {0}where the commands are replaced in.Possible Solution
Append
-NoProfileto the powershell/pwsh calls.`Steps to Reproduce
throw 'An error in your profile'-self-hostedact --platform windows-latest=-self-hosted --workflows "./.github/workflows/helloworld.yaml"Context
We are currently attach with
-P windows=self-hoston a windows machine.@HeyItsGilbert commented on GitHub (Nov 26, 2024):
Probably should be associated with #1608
@ChristopherHX commented on GitHub (Nov 27, 2024):
My expected behavior is to keep this in sync with the actions/runner program
shell: powershell.exe -NoProfile -command . '{0}'is well supported by both@HeyItsGilbert commented on GitHub (Nov 27, 2024):
I can totally understand why you would want to do that. I don't think they worry about that since they would never have profiles (that I know of). Nor would this ever be an issue on containers. The problem is when you run this on a local machine.
It feels like a bad trade off for users to have to edit all their workflows vs adding an additional flag. If you're keeping this in sync programmatically then I can try to submit the PR to the actions/runner repository.
@HeyItsGilbert commented on GitHub (Nov 27, 2024):
I think I may have found a compromise. Since the env contains
ACT, users can use that to skip loading potentially conflicting profiles.@tablackburn commented on GitHub (Mar 25, 2025):
Here's an example based on what I added to my profile