mirror of
https://github.com/nektos/act.git
synced 2026-04-26 09:25:54 +03:00
[GH-ISSUE #265] runner image does not correctly set environment variables #184
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#184
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 @christopherhesse on GitHub (Jun 4, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/265
When running with
act -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04theCONDAenvironment variable is not correctly set:On github this outputs:
Locally it outputs:
The file
/etc/environmentdoes seem to be present in thenektos/act-environments-ubuntu:18.04docker image with the correct values, I think it's not being used:@mk0x9 commented on GitHub (Jul 2, 2020):
Contents of
/etc/environmentonubuntu-latest@20200625.0image in github actions.Contents of
/etc/environmentonnektos/act-environments-ubuntu:18.04-full@69f4f815404cimage:@github-actions[bot] commented on GitHub (Sep 1, 2020):
Issue is stale and will be closed in 7 days unless there is new activity
@christopherhesse commented on GitHub (Sep 1, 2020):
Seems like this could still be an issue if
/etc/environmentis not being executed/used.@magneticflux- commented on GitHub (Nov 25, 2020):
I'm running into the same issue using
nektos/act-environments-ubuntu:18.04, but withImageOS:All the environment variables are blank when I try to print them.
@catthehacker commented on GitHub (Dec 2, 2020):
It's because
/etc/environmentis not sourced in Docker containers. You have to source it manually or it has to be done in the image itself. It's notactbug nor limitation.@wjdp commented on GitHub (Jan 11, 2021):
I have a step
from https://github.com/wjdp/gotdict/blob/master/.github/workflows/gotdict.yml
On GitHub this works fine. Running via act it fails (firstly with https://github.com/nektos/act/issues/311) and secondly with this issue:
@catthehacker commented on GitHub (Jan 11, 2021):
@mk0x9 My message above explains why it fails, to bypass that you can specify OS version in
.envfile e.g.:ImageOS=ubuntu18and use it via--env-file@github-actions[bot] commented on GitHub (Feb 11, 2021):
Issue is stale and will be closed in 14 days unless there is new activity
@Warns commented on GitHub (Feb 12, 2021):
@catthehacker Thanks, this worked fine.
I added a
.envfile in the root directory and referenced it in the related step.ci.yml.env@catthehacker commented on GitHub (Feb 12, 2021):
Since
actv0.2.19it's also possible to use just--env ImageOS=ubuntuXX@github-actions[bot] commented on GitHub (Mar 16, 2021):
Issue is stale and will be closed in 14 days unless there is new activity
@rockandska commented on GitHub (Mar 17, 2021):
Indeed, but
/etc/bash.bashrcis.Having to write specific code in workflows related to the usage of act locally should be avoided IMO.
Since those variables are available in GitHub Actions, it should be considered as a bug even if there is a workaround like
--env ImageOS=ubuntuXX@catthehacker commented on GitHub (Mar 17, 2021):
Which doesn't contain anything related to envvars. It shouldn't be used as workaround as well. The proper way is to invoke login shell.
That was a workaround.
Missing software related envvars. Not bug.
actnot using login shell to update environment. Bug 🐛Missing
ImageOSwhen runningact. Bug 🐛