Skip to content

Commit

Permalink
Adding --env-file docker-run-action.env from PR addnab#23
Browse files Browse the repository at this point in the history
  • Loading branch information
christopher-dejesus committed Jan 18, 2023
1 parent de1019e commit a12ed3a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

env | egrep -v "^(#|;| |PATH|SHLVL|HOSTNAME|DOCKER_*)" | awk '$1 ~ /^\w+=/' | xargs -0 > docker-run-action.env

if [ ! -z $INPUT_USERNAME ];
then echo $INPUT_PASSWORD | docker login $INPUT_REGISTRY -u $INPUT_USERNAME --password-stdin
fi
Expand All @@ -13,4 +15,4 @@ echo "Input Options: $INPUT_OPTIONS"
echo "Input Run: $INPUT_RUN"
echo "Input Shell: $INPUT_SHELL"

exec docker run -v "/var/run/docker.sock":"/var/run/docker.sock" $INPUT_OPTIONS --entrypoint=$INPUT_SHELL $INPUT_IMAGE -c "${INPUT_RUN//$'\n'/;}"
exec docker run --env-file docker-run-action.env -v "/var/run/docker.sock":"/var/run/docker.sock" $INPUT_OPTIONS --entrypoint=$INPUT_SHELL $INPUT_IMAGE -c "${INPUT_RUN//$'\n'/;}"

0 comments on commit a12ed3a

Please sign in to comment.