Skip to content

Commit

Permalink
feat: v1
Browse files Browse the repository at this point in the history
  • Loading branch information
jaironalves committed Apr 5, 2024
1 parent 5a600cd commit 10cb3bb
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
#!/bin/sh -l

_yaml_to_properties() {
local yaml_file="$1"
yq -o p --properties-separator ':' '... comments = ""' "$yaml_file"
}

_replace_dots() {
local string="$1"
local replacement="$2"
echo "$string" | awk -v rep="$replacement" 'BEGIN{FS=OFS=":"} {gsub(/\./,rep,$1); print}'
}

set -e

# Read the file using yq
yq e "$1"
yq -o p --properties-separator ':' '... comments = ""' "$1"

_properties=$(_yaml_to_properties "$YAMLPARSER_FILE_PATH")
_parsed_properties=$(_replace_dots "$properties" "_")

# Use INPUT_<INPUT_NAME> to get the value of an input
GREETING="Hello, $INPUT_WHO_TO_GREET!"
Expand Down

0 comments on commit 10cb3bb

Please sign in to comment.