Refactor setting environment variables

This commit is contained in:
Shivam Mathur
2022-01-18 04:41:51 +05:30
parent 0374a8ae84
commit 2b729b1130
4 changed files with 57 additions and 4 deletions

View File

@ -42,10 +42,10 @@ configure_composer() {
echo '{}' | tee "$composer_json" >/dev/null
chmod 644 "$composer_json"
fi
cat "${dist:?}"/../src/configs/composer.env >> "$GITHUB_ENV"
add_env_path "${dist:?}"/../src/configs/composer.env
add_path "$composer_bin"
if [ -n "$COMPOSER_TOKEN" ]; then
composer -q config -g github-oauth.github.com "$COMPOSER_TOKEN"
add_env COMPOSER_AUTH '{"github-oauth": {"github.com": "'"$COMPOSER_TOKEN"'"}}'
fi
}