-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07ec0bb
commit 3eb73bd
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: "env-load-from-yaml" | ||
description: "Load environment variables from a yaml file" | ||
inputs: | ||
ignore_regex: | ||
description: "Bash regex to ignore certain lines" | ||
required: false | ||
default: ^$ | ||
yml_path: | ||
description: "Path to the yaml file to parse" | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Parse env global | ||
run: | | ||
while read ENVVAR; do | ||
if [[ "$ENVVAR" =~ ${{ inputs.ignore_regex }} ]]; then | ||
echo "Skipping unwanted $ENVVAR" | ||
continue | ||
fi | ||
eval $ENVVAR | ||
echo "$(eval echo $ENVVAR)" >> $GITHUB_ENV | ||
done < <(yq '.env.global[]' ${{ inputs.yml_path }}) | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters