mirror of
https://github.com/nektos/act.git
synced 2026-04-28 10:25:54 +03:00
[GH-ISSUE #2396] docker compose setups are potentially loaded with environment from repository root instead of those from their own directory #1102
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#1102
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 @simon-20 on GitHub (Jul 12, 2024).
Original GitHub issue: https://github.com/nektos/act/issues/2396
Bug report info
Command used with act
Describe issue
When running a docker compose setup within a Github Actions workflow,
actdoes not load the docker compose with its correct environment file, but loads it with the environment variables loaded from the repository's root directory.For example, given the following repository structure:
Where
test.ymlis:The
docker composesetup is loaded with values from./.envand not./automated-test-environment/.env.This is different to what Github Actions does--Github Actions correctly loads the environment from
automated-test-environment/.env.The contents of
./.env:The contents of
./automated-test-environment/.env:Then, while the docker compose setup is running:
Link to GitHub repository
No response
Workflow content
Relevant log output
Additional information
May be related to: https://github.com/nektos/act/issues/2151
@ChristopherHX commented on GitHub (Jul 12, 2024):
Tell act to not load your .env, by creating
.act-env,.actrcwith content--env-file .act-env. After this only env variables of.act-envend up as global workflow variables within actTbh, act's defaults can never make everybody happy.
@simon-20 commented on GitHub (Jul 12, 2024):
Hi,
Thanks for that--it's allowed me to get it working without having to mangle the files in the repo.
Totally understand that the defaults can't keep everyone happy.
I guess the potential issue just is that the values in
.envare ordinarily application configuration variables and not workflow configuration variables, and Github Actions does not use the values in.envto setup the environment for the workflow. So whenactdoes this, it departs from Github Actions and may end up producing behaviour that is (i) unexpected, and (ii) different to that which occurs when the workflow is run on Github Actions.But anyway, it's straightforward enough to work around for most workflows. Thank you very much for your quick response.
@github-actions[bot] commented on GitHub (Jan 9, 2025):
Issue is stale and will be closed in 14 days unless there is new activity