setup-php 2.35.1 → 2.35.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -28,8 +28,8 @@ Function Edit-ComposerConfig() {
|
|
|
28
28
|
Set-ComposerAuth
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
# Function to
|
|
32
|
-
Function
|
|
31
|
+
# Function to update auth.json.
|
|
32
|
+
Function Update-AuthJson {
|
|
33
33
|
[CmdletBinding()]
|
|
34
34
|
param(
|
|
35
35
|
[Parameter(Mandatory)][string[]] $ComposerAuth
|
|
@@ -58,7 +58,7 @@ Function Get-MergedAuthJson {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
Set-Content -Path $composer_home\auth.json -Value ($existing | ConvertTo-Json -Depth 5)
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
# Function to setup authentication in composer.
|
|
@@ -81,7 +81,7 @@ Function Set-ComposerAuth() {
|
|
|
81
81
|
$composer_auth += '"github-oauth": {"github.com": "' + $env:GITHUB_TOKEN + '"}'
|
|
82
82
|
}
|
|
83
83
|
if($composer_auth.length) {
|
|
84
|
-
|
|
84
|
+
Update-AuthJson $composer_auth
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -47,7 +47,7 @@ configure_composer() {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
# Function to merge auth.json fragments.
|
|
50
|
-
|
|
50
|
+
update_auth_json() {
|
|
51
51
|
local auth_file="$composer_home/auth.json"
|
|
52
52
|
local merged
|
|
53
53
|
[[ -f "$auth_file" ]] && merged=$(<"$auth_file") || merged='{}'
|
|
@@ -62,7 +62,7 @@ get_merged_auth_json() {
|
|
|
62
62
|
end
|
|
63
63
|
')
|
|
64
64
|
done
|
|
65
|
-
printf '%s' "$merged"
|
|
65
|
+
printf '%s' "$merged" > "$composer_home/auth.json"
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
# Function to setup authentication in composer.
|
|
@@ -82,7 +82,7 @@ set_composer_auth() {
|
|
|
82
82
|
composer_auth+=( '"github-oauth": {"github.com": "'"${GITHUB_TOKEN:-$COMPOSER_TOKEN}"'"}' )
|
|
83
83
|
fi
|
|
84
84
|
if ((${#composer_auth[@]})); then
|
|
85
|
-
|
|
85
|
+
update_auth_json "${composer_auth[@]}"
|
|
86
86
|
fi
|
|
87
87
|
}
|
|
88
88
|
|