mirror of
https://github.com/nektos/act.git
synced 2026-04-26 01:15:51 +03:00
[PR #1100] [MERGED] Allow passed in env vars to supersede ones declared in the workflow #1775
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#1775
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?
📋 Pull Request Information
Original PR: https://github.com/nektos/act/pull/1100
Author: @liamphmurphy
Created: 4/2/2022
Status: ✅ Merged
Merged: 4/4/2022
Merged by: @mergify[bot]
Base:
master← Head:master📝 Commits (5)
92ad657don't merge env var if it exists already5ea04fcremove test workflow7c3678badd some tests41e3427change mergeMaps order instead of checking for existenceaf7a936Merge branch 'master' into master📊 Changes
2 files changed (+52 additions, -1 deletions)
View changed files
📝
pkg/runner/run_context.go(+1 -1)📝
pkg/runner/run_context_test.go(+51 -0)📄 Description
Simple approach to allowing for #1098
Since
github.com/nektos/act@b3bd268e45/pkg/runner/run_context.go (L78)specifies that therc.Config.envis the first map to iterate through (which is what contains any variables passed into act from the CLI), this simple duplicate check works for not letting the values of an env var in the workflow supersede what is passed into the CLI or env-files.Added a few tests as well, please let me know if anything should be adjusted.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.