Skip to content

Commit

Permalink
Fix ENV
Browse files Browse the repository at this point in the history
- Support Multi-Line ENV
- REMOVE system based ENV like PATH, DOCKER_VERSION -> that are generated in the next docker-in-docker run
  • Loading branch information
Dexus authored Jan 14, 2022
1 parent ef9d6a4 commit dc7d5ec
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/usr/bin/env bash

env | grep -v '^#' | xargs > docker-run-action.env
echo "" >docker-run-action.env
for env_var in $(env | cut -f1 -d"="); do
eval var=\$$env_var
if [[ -z $var ]] || [[ "$env_var" == "PATH" ]] || [[ "$env_var" == "DOCKER_VERSION" ]] ||
[[ "$env_var" == "_" ]] || [[ "$env_var" == "SHLVL" ]] || [[ "$env_var" == "PWD" ]]; then
continue
fi
echo "${env_var}=${var@Q}" >>docker-run-action.env
done

if [ ! -z $INPUT_USERNAME ];
then echo $INPUT_PASSWORD | docker login $INPUT_REGISTRY -u $INPUT_USERNAME --password-stdin
Expand Down

0 comments on commit dc7d5ec

Please sign in to comment.