mirror of
https://github.com/nektos/act.git
synced 2026-04-26 09:25:54 +03:00
[GH-ISSUE #1090] Issue: GITHUB_ACTIONS is always true #626
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#626
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 @KnisterPeter on GitHub (Mar 30, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1090
Not sure if we should changes this behavior, but I think it might be good to follow githubs recommendation for this variable.
Expected behaviour
According to the docs the environment variable
GITHUB_ACTIONSis set to true if the workflow is run byGITHUB_ACTIONSand it should be used to distinguish between local and non-local execution.Actual behaviour
In the
actcodebase this variables is statically set totrue.github.com/nektos/act@11c3fb39dd/pkg/runner/run_context.go (L604)@catthehacker commented on GitHub (Mar 30, 2022):
github.com/actions/runner@408d6c579c/src/Runner.Worker/Container/DockerCommandManager.cs (L143)github.com/actions/runner@408d6c579c/src/Runner.Worker/Container/DockerCommandManager.cs (L209)github.com/actions/runner@408d6c579c/src/Runner.Sdk/ProcessInvoker.cs (L272)@KnisterPeter commented on GitHub (Mar 30, 2022):
Yes, that's what I've meant. It is true if it is executed in a runner.
From the docs linked above:
@kevcube commented on GitHub (Apr 8, 2022):
@KnisterPeter IMO setting this to
truemakes sense.actis for simulating GitHub Actions workflow runs. If someone is checking$GITHUB_ACTIONSin an if-statement,actwill want them to take the path for if it weretrue, in order to properly simulate GitHub actions.@KnisterPeter commented on GitHub (Apr 8, 2022):
So then. I'll close this.