Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(action): check for any undefined environment variable in config #454

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

AtomicFS
Copy link
Collaborator

@AtomicFS AtomicFS commented Dec 2, 2024

  • until now it was rather hard to debug when the issue was one or more missing environment variables
  • with this patch, all environment detected variables in the JSON configuration file must be defined at the time of execution (can be empty)

Golang's os.ExpandEnv does not perform such check:

References to undefined variables are replaced by the empty string

fixes #384

@AtomicFS AtomicFS requested a review from MDr164 as a code owner December 2, 2024 15:16
@AtomicFS AtomicFS enabled auto-merge December 2, 2024 15:16
@github-actions github-actions bot added feature New feature or request testing Testing related labels Dec 2, 2024
@AtomicFS AtomicFS force-pushed the feat/undefined-env-vars branch 3 times, most recently from 99b7ddb to 07cb90e Compare December 3, 2024 11:47
action/recipes/config.go Outdated Show resolved Hide resolved
- until now it was rather hard to debug when the issue was one or more
  missing environment variables
- with this patch, all environment detected variables in the JSON
  configuration file must be defined at the time of execution

Signed-off-by: AtomicFS <vojtech.vesely@9elements.com>
@AtomicFS AtomicFS force-pushed the feat/undefined-env-vars branch from 07cb90e to 405ad6c Compare December 3, 2024 12:03
@AtomicFS AtomicFS requested a review from MDr164 December 3, 2024 12:05
@AtomicFS AtomicFS added this pull request to the merge queue Dec 3, 2024
Merged via the queue into main with commit af1bc10 Dec 3, 2024
86 checks passed
@AtomicFS AtomicFS deleted the feat/undefined-env-vars branch December 3, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request testing Testing related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

warn if JSON configuration contains undefined environment variables
2 participants