mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-07-26 00:29:08 +07:00
Refactor setting environment variables
This commit is contained in:
@ -22,10 +22,10 @@ Function Edit-ComposerConfig() {
|
||||
if (-not(Test-Path $composer_json)) {
|
||||
Set-Content -Path $composer_json -Value "{}"
|
||||
}
|
||||
Get-Content -Path $dist\..\src\configs\composer.env | Add-Content -Path $env:GITHUB_ENV
|
||||
Add-EnvPATH $dist\..\src\configs\composer.env
|
||||
Add-Path $composer_bin
|
||||
if (Test-Path env:COMPOSER_TOKEN) {
|
||||
composer -q config -g github-oauth.github.com $env:COMPOSER_TOKEN
|
||||
Add-Env COMPOSER_AUTH ('{"github-oauth": {"github.com": "' + $env:COMPOSER_TOKEN + '"}}')
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user