Skip to content

Commit

Permalink
Merge branch '40-env'
Browse files Browse the repository at this point in the history
# Conflicts:
#	action.yml
#	composer-action.bash
  • Loading branch information
g105b committed Jun 7, 2021
2 parents c115e89 + ddf3c64 commit d936bcb
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion composer-action.bash
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,23 @@ export COMPOSER_CACHE_DIR="/tmp/composer-cache"
unset ACTION_SSH_KEY
unset ACTION_SSH_KEY_PUB

dockerKeys=()
while IFS= read -r line
do
dockerKeys+=( $(echo "$line" | cut -f1 -d=) )
done <<<$(docker run --rm "${docker_tag}" env)

while IFS= read -r line
do
key=$(echo "$line" | cut -f1 -d=)
if printf '%s\n' "${dockerKeys[@]}" | grep -q -P "^${key}\$"
then
echo "Skipping env variable $key" >> output.log
else
echo "$line" >> DOCKER_ENV
fi
done <<<$(env)

echo "::set-output name=full_command::${command_string}"

docker run --rm \
Expand All @@ -152,7 +169,7 @@ docker run --rm \
--volume "${GITHUB_WORKSPACE}":/app \
--volume "/tmp/composer-cache":/tmp/composer-cache \
--workdir /app \
--env-file ./DOCKER_ENV \
--network host \
--env-file <( env| cut -f1 -d= ) \
${memory_limit} \
${docker_tag} ${command_string}

0 comments on commit d936bcb

Please sign in to comment.