setup-php 2.21.0 → 2.21.1

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "setup-php",
3
- "version": "2.21.0",
3
+ "version": "2.21.1",
4
4
  "private": false,
5
5
  "description": "Setup PHP for use with GitHub Actions",
6
6
  "main": "lib/install.js",
@@ -40,9 +40,9 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/jest": "^28.1.6",
43
- "@types/node": "^18.0.6",
44
- "@typescript-eslint/eslint-plugin": "^5.30.7",
45
- "@typescript-eslint/parser": "^5.30.7",
43
+ "@types/node": "^18.6.1",
44
+ "@typescript-eslint/eslint-plugin": "^5.31.0",
45
+ "@typescript-eslint/parser": "^5.31.0",
46
46
  "@vercel/ncc": "^0.34.0",
47
47
  "eslint": "^8.20.0",
48
48
  "eslint-config-prettier": "^8.5.0",
@@ -51,7 +51,7 @@
51
51
  "eslint-plugin-prettier": "^4.2.1",
52
52
  "jest": "^28.1.3",
53
53
  "jest-circus": "^28.1.3",
54
- "nock": "^13.2.8",
54
+ "nock": "^13.2.9",
55
55
  "prettier": "^2.7.1",
56
56
  "simple-git-hooks": "^2.8.0",
57
57
  "ts-jest": "^28.0.7",
@@ -201,11 +201,15 @@ Function Add-ComposertoolHelper() {
201
201
  [string]
202
202
  $composer_args
203
203
  )
204
+ $tool_version = $release.split(':')[1]
205
+ if($NULL -eq $tool_version) {
206
+ $tool_version = '*'
207
+ }
204
208
  if($scope -eq 'global') {
205
209
  if(Test-Path $composer_lock) {
206
210
  Remove-Item -Path $composer_lock -Force
207
211
  }
208
- if((composer global show $prefix$tool -a 2>&1 | findstr '^type *: *composer-plugin') -and ($composer_args -ne '')) {
212
+ if((composer global show $prefix$tool $tool_version -a 2>&1 | findstr '^type *: *composer-plugin') -and ($composer_args -ne '')) {
209
213
  composer global config --no-plugins allow-plugins."$prefix$tool" true >$null 2>&1
210
214
  }
211
215
  composer global require $prefix$release $composer_args >$null 2>&1
@@ -215,11 +219,12 @@ Function Add-ComposertoolHelper() {
215
219
  $scoped_dir_suffix = (Get-FileHash -InputStream $release_stream -Algorithm sha256).Hash
216
220
  $scoped_dir = "$composer_bin\_tools\$tool-$scoped_dir_suffix"
217
221
  $unix_scoped_dir = $scoped_dir.replace('\', '/')
218
- if((composer show $prefix$tool -d $unix_scoped_dir -a 2>&1 | findstr '^type *: *composer-plugin') -and ($composer_args -ne '')) {
219
- composer config -d $unix_scoped_dir --no-plugins allow-plugins."$prefix$release" true >$null 2>&1
220
- }
221
222
  if(-not(Test-Path $scoped_dir)) {
222
223
  New-Item -ItemType Directory -Force -Path $scoped_dir > $null 2>&1
224
+ Set-Content -Path $scoped_dir\composer.json -Value "{}"
225
+ if((composer show $prefix$tool $tool_version -d $unix_scoped_dir -a 2>&1 | findstr '^type *: *composer-plugin') -and ($composer_args -ne '')) {
226
+ composer config -d $unix_scoped_dir --no-plugins allow-plugins."$prefix$tool" true >$null 2>&1
227
+ }
223
228
  composer require $prefix$release -d $unix_scoped_dir $composer_args >$null 2>&1
224
229
  }
225
230
  [System.Environment]::SetEnvironmentVariable(($tool.replace('-', '_') + '_bin'), "$scoped_dir\vendor\bin")
@@ -160,9 +160,10 @@ add_composertool_helper() {
160
160
  scope=$4
161
161
  composer_args=$5
162
162
  enable_extensions curl mbstring openssl
163
+ tool_version=${release##*:}; [ "$tool_version" = "$tool" ] && tool_version="*"
163
164
  if [ "$scope" = "global" ]; then
164
165
  sudo rm -f "$composer_lock" >/dev/null 2>&1 || true
165
- if composer global show "$prefix$tool" -a 2>&1 | grep -qE '^type *: *composer-plugin' && [ -n "$composer_args" ]; then
166
+ if composer global show "$prefix$tool" "$tool_version" -a 2>&1 | grep -qE '^type *: *composer-plugin' && [ -n "$composer_args" ]; then
166
167
  composer global config --no-plugins allow-plugins."$prefix$tool" true >/dev/null 2>&1
167
168
  fi
168
169
  composer global require "$prefix$release" "$composer_args" >/dev/null 2>&1
@@ -172,7 +173,7 @@ add_composertool_helper() {
172
173
  if ! [ -d "$scoped_dir" ]; then
173
174
  mkdir -p "$scoped_dir"
174
175
  echo '{}' | tee "$scoped_dir/composer.json" >/dev/null
175
- if composer show "$prefix$tool" -d "$scoped_dir" -a 2>&1 | grep -qE '^type *: *composer-plugin' && [ -n "$composer_args" ]; then
176
+ if composer show "$prefix$tool" "$tool_version" -d "$scoped_dir" -a 2>&1 | grep -qE '^type *: *composer-plugin' && [ -n "$composer_args" ]; then
176
177
  composer config -d "$scoped_dir" --no-plugins allow-plugins."$prefix$tool" true >/dev/null 2>&1
177
178
  fi
178
179
  composer require "$prefix$release" -d "$scoped_dir" "$composer_args" >/dev/null 2>&1