Compare commits

..
88 Commits
Author SHA1 Message Date
Zoltan Kochan a3252b78c4 docs(README): update version 2024-02-08 11:28:50 +01:00
Erik BurtonandZoltan Kochan 1ee9c9d01d feat!: node20 upgrade (#110)
* upgrade versions to latest

* remove usage of ts-schema-autogen

* fix: update pnpm sources

* update build/output

* use node20

* fix: run-install array output

* fix: maintain behaviour for parseRunInstall, error messages

* fix: another edge case for input.args

* fix: use zod for input validation

* fix: use zod.infer for exported RunInstall types

* fix: remove @types/js-yaml

---------

Co-authored-by: Zoltan Kochan <[email protected]>
2024-02-08 11:22:15 +01:00
dependabot[bot] ebcfd6995d Bump actions/setup-node from 3 to 4 (#103)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-10 21:58:17 +02:00
Steven Yung d2613e087f docs: update pnpm version in caching example (#94) 2023-09-27 19:17:23 +03:00
dependabot[bot] d928be8e0c Bump actions/checkout from 3 to 4 (#96)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-27 19:17:06 +03:00
KhảiandTakashi Sato d882d12c64 feat: standalone binary (#92)
* feat: add an option to install the self-contained binary version of pnpm

* test: add a test about nodejs_bundled

* style: remove an empty line

* chore: use newer pnpm

* chore: update dependencies

* feat: rename `nodejs_bundled` to `standalone`

as @zkochan suggested

* docs: add

---------

Co-authored-by: Takashi Sato <[email protected]>
2023-07-26 14:50:04 +03:00
Khải 0b715c7ebb Merge pull request #75 from ojeytonwilliams/fix/caching-example
docs: update the caching example
2023-07-25 17:00:41 +07:00
Khải 2ed49cbb02 Merge pull request #88 from KengoTODA/make-path-configurable
support projects that have package.json in non-root directory
2023-07-25 16:59:00 +07:00
Khải 218cb35941 Merge pull request #69 from zakuro9715/zakuro9715-patch-2
Remove corepack url in error message
2023-07-25 14:16:42 +07:00
Khải 3723f63bb4 Merge pull request #90 from pnpm/optional-version
feat: make version actually optional
2023-07-25 14:05:04 +07:00
khai96_ 849d884800 feat: make version actually optional
closes https://github.com/pnpm/action-setup/issues/85
2023-07-25 14:01:28 +07:00
khai96_ f92eb0edb6 docs: update pnpm version in readme
fixes https://github.com/pnpm/action-setup/issues/89
2023-07-25 13:50:35 +07:00
Kengo TODA b27f801bf9 feat: add package_json_file option
Signed-off-by: Kengo TODA <[email protected]>
2023-07-08 07:02:46 +08:00
Khải 11dd14d0c0 Change sponsor to pnpm's opencollective 2023-04-22 17:39:01 +07:00
Oliver Eyton-Williams 61eb8c655a docs: update the caching example 2023-03-08 00:13:47 +01:00
zakuro 65db188e28 Remove corepack url in error message 2022-11-09 06:54:12 +09:00
Khải 0609f0983b Merge pull request #66 from mrienstra/patch-1
docs: drop minor & patch version from examples
2022-11-02 12:09:43 +07:00
Michael Rienstra 7208fa2733 docs: drop minor & patch version from examples 2022-11-01 21:55:20 -07:00
Khải 1bd00a2972 Merge pull request #64 from mrienstra/patch-1
typo: not latest version
2022-10-26 10:32:07 +07:00
Michael Rienstra d5601fb603 bump first occurrence of actions/checkout to v3 2022-10-25 10:52:54 -07:00
Michael Rienstra bc06aa6030 typo: not latest version 2022-10-25 10:42:24 -07:00
Khải cd2af74528 Merge pull request #62 from melMass/mel/fix-readme
fix: ⚡️ cross-platform example
2022-10-18 17:29:18 +07:00
Mel Massadian c8a150e137 fix: ⚡️ just use shell:bash
set-output is deprecated see #58
2022-10-18 12:23:15 +02:00
Mel Massadian ed0172a253 fix: ⚡️ cross-platform example 2022-10-18 12:02:38 +02:00
Zoltan Kochan c3b53f6a16 chore(release): 2.2.4 2022-10-15 21:12:50 +03:00
Zoltan Kochan 21e88da200 fix(deps): update 2022-10-15 21:12:13 +03:00
Zoltan Kochan fc3334fa11 build 2022-10-15 21:09:00 +03:00
Sébastien Vanvelthem d01953a678 Update action/core to 1.10.0 to fix deprecation warnings (#59)
* chore: update action/core to 1.10.0

* chore(lock): freshen
2022-10-15 20:57:21 +03:00
Khải 3360b50db7 Merge pull request #58 from belgattitude/doc-adapt-to-new-github-env
Doc update to account for deprecated `set-output`.
2022-10-13 22:23:23 +07:00
Sébastien Vanvelthem 6f9e9a867a docs: update to new github env 2022-10-13 16:58:06 +02:00
Khải 537643d491 Merge pull request #56 from i7eo/master
chore: bump node version
2022-10-11 11:58:06 +07:00
George Tan f4129fb46e fix
Update node version, see https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
2022-10-11 10:56:24 +08:00
Lew Blood 6e1964dde3 Fix spacing issue in README.md example (#48) 2022-06-17 23:17:05 +03:00
Zoltan Kochan 10693b3829 Update action.yml 2022-05-28 17:23:43 +03:00
Zoltan Kochan 99ecd24520 v2.2.2 2022-05-28 17:22:28 +03:00
Zoltan Kochan 958500fcab fix: do not download pnpm from get.pnpm.io (#46)
* fix: do not download pnpm from get.pnpm.io

* fix: remove redundant files
2022-05-28 16:54:43 +03:00
Khải 57b9359b4c Merge pull request #41 from nelson6e65/patch-1
docs(readme): improve Cache example
2022-05-07 10:00:37 +07:00
Khải ec1a8b444c Change runs-on back to ubuntu-latest 2022-05-07 09:59:56 +07:00
Nelson Martell 73e15250cb docs(readme): improve and fix cache example
Dynamically detect the Store directory and use the latest GitHub actions.
2022-05-06 21:57:00 -05:00
Khải 10b4b0b462 Merge pull request #36 from pnpm/dependabot/github_actions/actions/checkout-3
Bump actions/checkout from 2 to 3
2022-03-08 10:33:01 +07:00
Khải 5fa8980bf4 Update dependabot.yml 2022-03-08 10:32:48 +07:00
dependabot[bot] ae78e9abbe Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-03-07 23:02:26 +00:00
Jack Works 35ab4267a1 fix: packageManager reader (#35)
* fix: packageManager reader

* chore: resolve review

* chore: run build
2022-02-25 12:43:26 +08:00
khai96_ 11ba3424e0 fmt 2022-02-23 10:07:15 +07:00
Khải 847a737d63 Merge pull request #33 from pnpm/packageManager
feat: try support packageManager
2022-02-22 16:39:23 +07:00
Zoltan Kochan 225f3bb4b0 build 2022-02-22 11:34:20 +02:00
Zoltan Kochan 777a50d72e Update src/install-pnpm/run.ts 2022-02-22 11:32:59 +02:00
khai96_ e7c10c6fc5 Update dist/index.js 2022-02-22 13:04:41 +07:00
Jack Works a576a70bc6 chore: resolve review 2022-02-22 13:37:35 +08:00
Jack Works 1d51e20937 feat: try support packageManager 2022-02-22 12:26:05 +08:00
Khải ad2b35ae0c Merge pull request #32 from pnpm/retry-fetch
fix: retry fetch of pnpm script
2022-02-21 10:28:16 +07:00
Zoltan Kochan d8ea532ac4 fix: retry fetch of pnpm script
close #22
2022-02-20 21:49:26 +02:00
khai96_ 2270f39ef6 v2.1.0 2022-02-08 19:53:18 +07:00
khai96_ 394c848db6 Update the bundle 2022-02-08 19:50:57 +07:00
Khải e13928ccc5 Merge pull request #27 from metonym/fix-jobs-syntax
Specify job name to fix syntax error
2022-02-08 19:48:36 +07:00
Khải 93bd5a123d Merge pull request #29 from pnpm/pnpm-v7
The pnpm home directory should be added to PATH and PNPM_HOME
2022-02-08 19:47:28 +07:00
Zoltan Kochan 9eb14dd77c decrease bundle size 2022-02-08 14:44:50 +02:00
Zoltan Kochan eafb777c56 download script from pnpm.io 2022-02-08 00:39:20 +02:00
Zoltan Kochan e6378df420 PNPM_HOME_PATH=>PNPM_HOME 2022-02-08 00:21:53 +02:00
Zoltan Kochan 6ff6e97bc6 The pnpm home directory should be added to PATH and PNPM_HOME
This change is needed to make the action compatible with pnpm v7.

Related breaking change in pnpm: pnpm/pnpm#4280
2022-02-07 23:15:44 +02:00
Eric Liu 45d9c91ff6 Specify job name to fix syntax error 2022-01-29 08:17:29 -08:00
Khải 15569a497d Merge pull request #26 from ai/patch-1
Improve `version` docs
2021-12-16 21:20:06 +07:00
Andrey SitnikandKhải d70eebd14a Update README.md
Co-authored-by: Khải <[email protected]>
2021-12-16 17:18:46 +03:00
Andrey Sitnik 3bf8acf16f Improve version docs 2021-12-16 17:12:07 +03:00
Khải 3c2fe8c592 Merge pull request #21 from gaggle/patch-1
Spelling
2021-10-12 19:45:45 +07:00
Jon Lauridsen 76cc04cd5e Spelling 2021-10-12 13:34:10 +02:00
Khải bcad811784 Remove unused env from examples 2021-07-24 08:25:23 +07:00
Khải 602b36f177 Remove uses of undefined variables from examples 2021-07-24 08:22:22 +07:00
Khải 74a0fdc1a4 Merge pull request #14 from Jack-Works-forks/master
Update README: use lockfile hash instead of package.json hash
2021-06-01 09:44:13 +07:00
Jack Works 493e98ec5e Update README.md 2021-06-01 10:42:26 +08:00
khai96_ 646cdf4821 Update versions in README examples to the latest 2021-04-24 21:13:36 +07:00
Khải a1ba6cf5ae Merge pull request #11 from pnpm/zkochan-patch-1
docs(readme): PNPM=>pnpm
2021-03-27 18:50:58 +07:00
Zoltan Kochan 41b381a08b docs(readme): PNPM=>pnpm 2021-03-27 13:45:01 +02:00
khai96_ 3236b209b5 Merge branch 'v2' 2021-03-27 16:56:27 +07:00
khai96_ 2124926520 Update README.md 2021-03-23 12:53:37 +07:00
khai96_ ba9826e81c Update test workflow 2021-03-23 12:53:25 +07:00
khai96_ 7c4472dbcf Forgot to specify working directory 2021-03-23 12:48:54 +07:00
khai96_ 0db7fb9961 Add .pnpm-store to .gitignore 2021-03-23 12:48:07 +07:00
khai96_ aefcd1e623 Use pnpm.js to install pnpm 2021-03-23 12:42:43 +07:00
khai96_ b7b9d6344b Instruct renovate to ignore ajv updates 2021-03-23 11:47:55 +07:00
khai96_ 7e61ea5847 Add "$schema" to renovate.json 2021-03-23 11:46:56 +07:00
khai96_ 3a2c7247e1 Fix js-yaml usage 2021-03-23 11:43:49 +07:00
khai96_ 2a105263a5 Update dependencies 2021-03-23 11:43:36 +07:00
Khải 9facd4db8e Merge pull request #9 from hildjj/cache-docs
Adds documentation hints for caching
2021-02-18 08:31:04 +07:00
Khải 6c1466d327 Make some tweaks to example code snippets 2021-02-18 08:30:07 +07:00
Joe Hildebrand b26427e53e Adds documentation hints for caching. Fixes #8. 2021-02-17 09:45:25 -07:00
Khải 086f5bd3b6 Update README.md
close https://github.com/pnpm/action-setup/issues/6
2020-10-19 14:10:51 +07:00
khai96_ bdb2a5ee76 Enable Dependabot 2020-10-05 22:16:14 +07:00
28 changed files with 237909 additions and 1016 deletions

No files matched your search

+2 -12
View File
@@ -1,12 +1,2 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: khai96_
open_collective: # Collective unavailable
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # disabled
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
custom:
- https://opencollective.com/pnpm
+7
View File
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
+60 -7
View File
@@ -22,7 +22,7 @@ jobs:
- windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run the action
uses: ./
@@ -35,8 +35,8 @@ jobs:
- name: 'Test: install'
run: pnpm install
test_explicit_inputs:
name: Test with explicit inputs
test_dest:
name: Test with dest
runs-on: ${{ matrix.os }}
@@ -51,15 +51,13 @@ jobs:
- windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run the action
uses: ./
with:
version: 4.11.1
dest: ~/test/pnpm
bin_dest: ~/test/pnpm/.bin
registry: http://registry.yarnpkg.com/
- name: 'Test: which'
run: which pnpm && which pnpx
@@ -67,6 +65,61 @@ jobs:
- name: 'Test: install'
run: pnpm install
test_standalone:
name: Test with standalone
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
standalone:
- true
- false
steps:
- uses: actions/checkout@v4
- name: Run the action
uses: ./
with:
version: 7.0.0
standalone: ${{ matrix.standalone }}
- name: install Node.js
uses: actions/setup-node@v4
with:
# [email protected] is not compatible with Node.js 12
node-version: 12.22.12
- name: 'Test: which (pnpm)'
run: which pnpm
- name: 'Test: which (pnpx)'
if: matrix.standalone == false
run: which pnpx
- name: 'Test: install when standalone is true'
if: matrix.standalone
run: pnpm install
- name: 'Test: install when standalone is false'
if: matrix.standalone == false
# Since the default shell on windows runner is pwsh, we specify bash explicitly
shell: bash
run: |
if pnpm install; then
echo "pnpm install should fail"
exit 1
else
echo "pnpm install failed as expected"
fi
test_run_install:
name: 'Test with run_install (${{ matrix.run_install.name }}, ${{ matrix.os }})'
@@ -109,7 +162,7 @@ jobs:
- pnpm
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run the action
uses: ./
+3
View File
@@ -2,9 +2,12 @@ node_modules
*.log
/dist/*
!/dist/index.js
!/dist/pnpm.cjs
!/dist/worker.js
tmp
temp
*.tmp
*.temp
tmp.*
temp.*
.pnpm-store
+83 -30
View File
@@ -1,24 +1,20 @@
# Setup PNPM
# Setup pnpm
Install PNPM package manager.
Install pnpm package manager.
## Inputs
### `version`
**Required** Version of PNPM to install.
Version of pnpm to install.
**Optional** when there is a [`packageManager` field in the `package.json`](https://nodejs.org/api/corepack.html).
otherwise, this field is **required** It supports npm versioning scheme, it could be an exact version (such as `6.24.1`), or a version range (such as `6`, `6.x.x`, `6.24.x`, `^6.24.1`, `*`, etc.), or `latest`.
### `dest`
**Optional** Where to store PNPM files.
### `bin_dest`
**Optional** Where to store executables (`pnpm` and `pnpx` commands).
### `registry`
**Optional** (_default:_ `https://registry.npmjs.com`) Registry to download PNPM from.
**Optional** Where to store pnpm files.
### `run_install`
@@ -42,6 +38,16 @@ If `run_install` is a YAML string representation of either an object or an array
**Optional** (_type:_ `string[]`) Additional arguments after `pnpm [recursive] install`, e.g. `[--frozen-lockfile, --strict-peer-dependencies]`.
### `package_json_file`
**Optional** (_type:_ `string`, _default:_ `package.json`) File path to the `package.json` to read "packageManager" configuration.
### `standalone`
**Optional** (_type:_ `boolean`, _default:_ `false`) When set to true, [@pnpm/exe](https://www.npmjs.com/package/@pnpm/exe), which is a Node.js bundled package, will be installed, enabling using `pnpm` without Node.js.
This is useful when you want to use a incompatible pair of Node.js and pnpm.
## Outputs
### `dest`
@@ -50,11 +56,11 @@ Expanded path of inputs#dest.
### `bin_dest`
Expanded path of inputs#bin_dest.
Location of `pnpm` and `pnpx` command.
## Usage example
### Just install PNPM
### Just install pnpm
```yaml
on:
@@ -62,15 +68,16 @@ on:
- pull_request
jobs:
runs-on: ubuntu-latest
install:
runs-on: ubuntu-latest
steps:
- uses: pnpm/action-setup@v1.2.0
with:
version: 4.11.1
steps:
- uses: pnpm/action-setup@v3
with:
version: 8
```
### Install PNPM and a few NPM packages
### Install pnpm and a few npm packages
```yaml
on:
@@ -78,20 +85,66 @@ on:
- pull_request
jobs:
runs-on: ubuntu-latest
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v1.2.0
with:
version: 4.11.1
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- args: [--global, gulp, prettier, typescript]
- uses: pnpm/action-setup@v3
with:
version: 8
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- args: [--global, gulp, prettier, typescript]
```
### Use cache to reduce installation time
```yaml
on:
- push
- pull_request
jobs:
cache-and-install:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
```
**Note:** You don't need to run `pnpm store prune` at the end; post-action has already taken care of that.
## Notes
This action does not setup Node.js for you, use [actions/setup-node](https://github.com/actions/setup-node) yourself.
+14 -14
View File
@@ -1,29 +1,29 @@
name: Setup PNPM
description: Install PNPM package manager
name: Setup pnpm
description: Install pnpm package manager
branding:
icon: package
color: orange
inputs:
version:
description: Version of PNPM to install
required: true
description: Version of pnpm to install
required: false
dest:
description: Where to store PNPM files
description: Where to store pnpm files
required: false
default: ~/setup-pnpm
bin_dest:
description: Where to store executables (pnpm and pnpx commands)
required: false
default: ~/setup-pnpm/.bin
registry:
description: Registry to download PNPM from
required: false
default: https://registry.npmjs.com
run_install:
description: If specified, run `pnpm install`
required: false
default: 'null'
package_json_file:
description: File path to the package.json to read "packageManager" configuration
required: false
default: 'package.json'
standalone:
description: When set to true, @pnpm/exe, which is a Node.js bundled package, will be installed, enabling using pnpm without Node.js.
required: false
default: 'false'
runs:
using: node12
using: node20
main: dist/index.js
post: dist/index.js
+10 -1
View File
@@ -1 +1,10 @@
module.exports=function(n,e){"use strict";var f={};function __webpack_require__(e){if(f[e]){return f[e].exports}var r=f[e]={i:e,l:false,exports:{}};var l=true;try{n[e].call(r.exports,r,r.exports,__webpack_require__);l=false}finally{if(l)delete f[e]}r.l=true;return r.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(984)}return startup()}({15:function(n){"use strict";n.exports=function generate_comment(n,e,f){var r=" ";var l=n.schema[e];var s=n.errSchemaPath+"/"+e;var v=!n.opts.allErrors;var c=n.util.toQuotedString(l);if(n.opts.$comment===true){r+=" console.log("+c+");"}else if(typeof n.opts.$comment=="function"){r+=" self._opts.$comment("+c+", "+n.util.toQuotedString(s)+", validate.root.schema);"}return r}},23:function(n,e,f){"use strict";var r=f(636);function resolveYamlBoolean(n){if(n===null)return false;var e=n.length;return e===4&&(n==="true"||n==="True"||n==="TRUE")||e===5&&(n==="false"||n==="False"||n==="FALSE")}function constructYamlBoolean(n){return n==="true"||n==="True"||n==="TRUE"}function isBoolean(n){return Object.prototype.toString.call(n)==="[object Boolean]"}n.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:resolveYamlBoolean,construct:constructYamlBoolean,predicate:isBoolean,represent:{lowercase:function(n){return n?"true":"false"},uppercase:function(n){return n?"TRUE":"FALSE"},camelcase:function(n){return n?"True":"False"}},defaultStyle:"lowercase"})},43:function(n,e,f){"use strict";var r=f(379),l=f(953),s=f(708),v=f(62);var c=f(687);var p=l.ucs2length;var b=f(926);var g=s.Validation;n.exports=compile;function compile(n,e,f,i){var w=this,d=this._opts,A=[undefined],j={},E=[],F={},O=[],R={},z=[];e=e||{schema:n,refVal:A,refs:j};var I=checkCompiling.call(this,n,e,i);var U=this._compilations[I.index];if(I.compiling)return U.callValidate=callValidate;var C=this._formats;var q=this.RULES;try{var Q=localCompile(n,e,f,i);U.validate=Q;var B=U.callValidate;if(B){B.schema=Q.schema;B.errors=null;B.refs=Q.refs;B.refVal=Q.refVal;B.root=Q.root;B.$async=Q.$async;if(d.sourceCode)B.source=Q.source}return Q}finally{endCompiling.call(this,n,e,i)}function callValidate(){var n=U.validate;var e=n.apply(this,arguments);callValidate.errors=n.errors;return e}function localCompile(n,f,v,i){var F=!f||f&&f.schema==n;if(f.schema!=e.schema)return compile.call(w,n,f,v,i);var R=n.$async===true;var I=c({isTop:true,schema:n,isRoot:F,baseId:i,root:f,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:s.MissingRef,RULES:q,validate:c,util:l,resolve:r,resolveRef:resolveRef,usePattern:usePattern,useDefault:useDefault,useCustomRule:useCustomRule,opts:d,formats:C,logger:w.logger,self:w});I=vars(A,refValCode)+vars(E,patternCode)+vars(O,defaultCode)+vars(z,customRuleCode)+I;if(d.processCode)I=d.processCode(I,n);var U;try{var Q=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",I);U=Q(w,q,C,e,A,O,z,b,p,g);A[0]=U}catch(n){w.logger.error("Error compiling schema, function code:",I);throw n}U.schema=n;U.errors=null;U.refs=j;U.refVal=A;U.root=F?U:f;if(R)U.$async=true;if(d.sourceCode===true){U.source={code:I,patterns:E,defaults:O}}return U}function resolveRef(n,l,s){l=r.url(n,l);var v=j[l];var c,p;if(v!==undefined){c=A[v];p="refVal["+v+"]";return resolvedRef(c,p)}if(!s&&e.refs){var b=e.refs[l];if(b!==undefined){c=e.refVal[b];p=addLocalRef(l,c);return resolvedRef(c,p)}}p=addLocalRef(l);var g=r.call(w,localCompile,e,l);if(g===undefined){var i=f&&f[l];if(i){g=r.inlineRef(i,d.inlineRefs)?i:compile.call(w,i,e,f,n)}}if(g===undefined){removeLocalRef(l)}else{replaceLocalRef(l,g);return resolvedRef(g,p)}}function addLocalRef(n,e){var f=A.length;A[f]=e;j[n]=f;return"refVal"+f}function removeLocalRef(n){delete j[n]}function replaceLocalRef(n,e){var f=j[n];A[f]=e}function resolvedRef(n,e){return typeof n=="object"||typeof n=="boolean"?{code:e,schema:n,inline:true}:{code:e,$async:n&&!!n.$async}}function usePattern(n){var e=F[n];if(e===undefined){e=F[n]=E.length;E[e]=n}return"pattern"+e}function useDefault(n){switch(typeof n){case"boolean":case"number":return""+n;case"string":return l.toQuotedString(n);case"object":if(n===null)return"null";var e=v(n);var f=R[e];if(f===undefined){f=R[e]=O.length;O[f]=n}return"default"+f}}function useCustomRule(n,e,f,r){if(w._opts.validateSchema!==false){var l=n.definition.dependencies;if(l&&!l.every(function(n){return Object.prototype.hasOwnProperty.call(f,n)}))throw new Error("parent schema must have all required keywords: "+l.join(","));var s=n.definition.validateSchema;if(s){var v=s(e);if(!v){var c="keyword schema is invalid: "+w.errorsText(s.errors);if(w._opts.validateSchema=="log")w.logger.error(c);else throw new Error(c)}}}var p=n.definition.compile,b=n.definition.inline,g=n.definition.macro;var i;if(p){i=p.call(w,e,f,r)}else if(g){i=g.call(w,e,f,r);if(d.validateSchema!==false)w.validateSchema(i,true)}else if(b){i=b.call(w,r,n.keyword,e,f)}else{i=n.definition.validate;if(!i)return}if(Line truncated
(()=>{var e={276:function(e,t,A){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const r=A(9093);const n=s(A(1784));const i=s(A(2960));const o=s(A(7650));const a=s(A(9462));const c=s(A(8307));async function main(){const e=(0,n.default)();const t=(0,r.getState)("is_post");if(t==="true")return(0,c.default)(e);(0,r.saveState)("is_post","true");await(0,i.default)(e);console.log("Installation Completed!");(0,o.default)(e);(0,a.default)(e)}main().catch((e=>{console.error(e);(0,r.setFailed)(e)}))},1784:function(e,t,A){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getInputs=void 0;const r=A(9093);const n=s(A(1791));const i=A(7090);const o={required:true};const parseInputPath=e=>(0,n.default)((0,r.getInput)(e,o));const getInputs=()=>({version:(0,r.getInput)("version"),dest:parseInputPath("dest"),runInstall:(0,i.parseRunInstall)("run_install"),packageJsonFile:parseInputPath("package_json_file"),standalone:(0,r.getBooleanInput)("standalone")});t.getInputs=getInputs;t["default"]=t.getInputs},7090:function(e,t,A){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,A,s){if(s===undefined)s=A;var r=Object.getOwnPropertyDescriptor(t,A);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[A]}}}Object.defineProperty(e,s,r)}:function(e,t,A,s){if(s===undefined)s=A;e[s]=t[A]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var A in e)if(A!=="default"&&Object.prototype.hasOwnProperty.call(e,A))s(t,e,A);r(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.parseRunInstall=void 0;const i=A(9093);const o=n(A(2825));const a=A(8553);const c=a.z.object({recursive:a.z.boolean().optional(),cwd:a.z.string().optional(),args:a.z.array(a.z.string()).optional()});const l=a.z.union([a.z.null(),a.z.boolean(),c,a.z.array(c)]);function parseRunInstall(e){const t=(0,i.getInput)(e,{required:true});const A=o.parse(t);try{const e=l.parse(A);if(!e)return[];if(e===true)return[{recursive:true}];if(Array.isArray(e))return e;return[e]}catch(A){(0,i.error)(`Error for input "${e}" = ${t}`);if(A instanceof a.ZodError){(0,i.error)(`Errors: ${A.errors}`)}else{(0,i.error)(`Exception: ${A}`)}process.exit(1)}}t.parseRunInstall=parseRunInstall},2960:function(e,t,A){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.install=t.runSelfInstaller=void 0;const r=A(9093);const n=s(A(9530));t.runSelfInstaller=n.default;async function install(e){(0,r.startGroup)("Running self-installer...");const t=await(0,n.default)(e);(0,r.endGroup)();if(t){return(0,r.setFailed)(`Something went wrong, self-installer exits with code ${t}`)}}t.install=install;t["default"]=install},9530:function(e,t,A){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.runSelfInstaller=void 0;const r=A(9093);const n=A(2081);const i=A(3175);const o=s(A(1017));const a=A(7282);async function runSelfInstaller(e){const{version:t,dest:A,packageJsonFile:s,standalone:c}=e;await(0,i.remove)(A);const l=o.default.join(A,"package.json");await(0,i.ensureFile)(l);await(0,i.writeFile)(l,JSON.stringify({private:true}));const u=await readTarget({version:t,packageJsonFile:s,standalone:c});const g=(0,n.spawn)(a.execPath,[o.default.join(__dirname,"pnpm.cjs"),"install",u,"--no-lockfile"],{cwd:A,stdio:["pipe","inherit","inherit"]});const h=await new Promise(((e,t)=>{g.on("error",t);g.on("close",e)}));if(h===0){const e=o.default.join(A,"node_modules/.bin");(0,r.addPath)(e);(0,r.exportVariable)("PNPM_HOME",e)}return h}t.runSelfInstaller=runSelfInstaller;async function readTarget(e){const{version:t,packageJsonFile:A,standalone:s}=e;if(t)return`${s?"@pnpm/exe":"pnpm"}@${t}`;const{GITHUB_WORKSPACE:r}=process.env;if(!r){throw new Error(`No workspace is found.\nIf you're intended to let pnpm/action-setup read preferred pnpm version from the "packageManager" field in the package.json file,\nplease run the actions/checkout before pnpm/action-setup.\nOtherwise, please specify the pnpm version in the action configuration.`)}const{packageManager:n}=JSON.parse(await(0,i.readFile)(o.default.join(r,A),"utf8"));if(typeof n!=="string"){throw new Error(`No pnpm version is specified.\nPlease specify it by one of the following ways:\n - in the GitHub Action config with the key "version"\n - in the package.json with the key "packageManager"`)}if(!n.startsWith("pnpm@")){throw new Error("Invalid packageManager field in package.json")}if(s){return n.replace("pnpm@Line truncated
/*!
* expand-tilde <https://github.com/jonschlinkert/expand-tilde>
*
* Copyright (c) 2015 Jon Schlinkert.
* Licensed under the MIT license.
*/
var s=A(9171);var r=A(1017);e.exports=function expandTilde(e){var t=s();if(e.charCodeAt(0)===126){if(e.charCodeAt(1)===43){return r.join(process.cwd(),e.slice(2))}return t?r.join(t,e.slice(1)):e}return e}},5524:(e,t,A)=>{"use strict";const s=A(7804);const r=A(1017);const n=A(8516).mkdirsSync;const i=A(7227).utimesMillisSync;const o=A(8826);function copySync(e,t,A){if(typeof A==="function"){A={filter:A}}A=A||{};A.clobber="clobber"in A?!!A.clobber:true;A.overwrite="overwrite"in A?!!A.overwrite:A.clobber;if(A.preserveTimestamps&&process.arch==="ia32"){process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n"+"\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002")}const{srcStat:i,destStat:a}=o.checkPathsSync(e,t,"copy",A);o.checkParentPathsSync(e,i,t,"copy");if(A.filter&&!A.filter(e,t))return;const c=r.dirname(t);if(!s.existsSync(c))n(c);return getStats(a,e,t,A)}function getStats(e,t,A,r){const n=r.dereference?s.statSync:s.lstatSync;const i=n(t);if(i.isDirectory())return onDir(i,e,t,A,r);else if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return onFile(i,e,t,A,r);else if(i.isSymbolicLink())return onLink(e,t,A,r);else if(i.isSocket())throw new Error(`Cannot copy a socket file: ${t}`);else if(i.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${t}`);throw new Error(`Unknown file: ${t}`)}function onFile(e,t,A,s,r){if(!t)return copyFile(e,A,s,r);return mayCopyFile(e,A,s,r)}function mayCopyFile(e,t,A,r){if(r.overwrite){s.unlinkSync(A);return copyFile(e,t,A,r)}else if(r.errorOnExist){throw new Error(`'${A}' already exists`)}}function copyFile(e,t,A,r){s.copyFileSync(t,A);if(r.preserveTimestamps)handleTimestamps(e.mode,t,A);return setDestMode(A,e.mode)}function handleTimestamps(e,t,A){if(fileIsNotWritable(e))makeFileWritable(A,e);return setDestTimestamps(t,A)}function fileIsNotWritable(e){return(e&128)===0}function makeFileWritable(e,t){return setDestMode(e,t|128)}function setDestMode(e,t){return s.chmodSync(e,t)}function setDestTimestamps(e,t){const A=s.statSync(e);return i(t,A.atime,A.mtime)}function onDir(e,t,A,s,r){if(!t)return mkDirAndCopy(e.mode,A,s,r);return copyDir(A,s,r)}function mkDirAndCopy(e,t,A,r){s.mkdirSync(A);copyDir(t,A,r);return setDestMode(A,e)}function copyDir(e,t,A){s.readdirSync(e).forEach((s=>copyDirItem(s,e,t,A)))}function copyDirItem(e,t,A,s){const n=r.join(t,e);const i=r.join(A,e);if(s.filter&&!s.filter(n,i))return;const{destStat:a}=o.checkPathsSync(n,i,"copy",s);return getStats(a,n,i,s)}function onLink(e,t,A,n){let i=s.readlinkSync(t);if(n.dereference){i=r.resolve(process.cwd(),i)}if(!e){return s.symlinkSync(i,A)}else{let e;try{e=s.readlinkSync(A)}catch(e){if(e.code==="EINVAL"||e.code==="UNKNOWN")return s.symlinkSync(i,A);throw e}if(n.dereference){e=r.resolve(process.cwd(),e)}if(o.isSrcSubdir(i,e)){throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${e}'.`)}if(o.isSrcSubdir(e,i)){throw new Error(`Cannot overwrite '${e}' with '${i}'.`)}return copyLink(i,A)}}function copyLink(e,t){s.unlinkSync(t);return s.symlinkSync(e,t)}e.exports=copySync},5770:(e,t,A)=>{"use strict";const s=A(5845);const r=A(1017);const{mkdirs:n}=A(8516);const{pathExists:i}=A(9667);const{utimesMillis:o}=A(7227);const a=A(8826);async function copy(e,t,A={}){if(typeof A==="function"){A={filter:A}}A.clobber="clobber"in A?!!A.clobber:true;A.overwrite="overwrite"in A?!!A.overwrite:A.clobber;if(A.preserveTimestamps&&process.arch==="ia32"){process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n"+"\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001")}const{srcStat:s,destStat:o}=await a.checkPaths(e,t,"copy",A);await a.checkParentPaths(e,s,t,"copy");const c=await runFilter(e,t,A);if(!c)return;const l=r.dirname(t);const u=await i(l);if(!u){await n(l)}await getStatsAndPerformCopy(o,e,t,A)}async function runFilter(e,t,A){if(!A.filter)return true;return A.filter(e,t)}async function getStatsAndPerformCopy(e,t,A,r){const n=r.dereference?s.stat:s.lstat;const i=await n(t);if(i.isDirectory())return onDir(i,e,t,A,r);if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return onFile(i,e,t,A,r);if(i.isSymbolicLink())return onLink(e,t,A,r);if(i.isSocket())throw new Error(`Cannot copy a socket file: ${t}`);if(i.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${t}`);throw new Error(`Unknown file: ${t}`)}async function onFile(e,t,A,r,n){if(!t)return copyFile(e,A,r,n);if(n.overwrite){await s.unlink(r);return copyFile(e,A,r,n)}if(n.errorOnExist){throw new Error(`'${r}' already exists`)}}async function copyFile(e,t,A,r){await s.copyFile(t,A);if(r.preserveTimestamps){if(fileIsNotWritable(e.mode)){await makeFileWritable(A,e.mode)}const r=await s.stat(t);await o(A,r.atime,r.mtime)}return s.chmod(A,e.mode)}function fileIsNotWritable(e){return(e&128)===0}function makeFileWritable(e,t){return s.chmod(e,t|128)}async function onDir(e,t,A,n,i){if(!t){await s.mkdir(n)}conLine truncated
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=e=>e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=e=>e.replace(/\r?\n|\r/g,"\r\n");const s=[];const r=new Uint8Array([13,10]);u=0;let n=false;for(const[t,i]of e){if(typeof i==="string"){const e=R.encode(A+`; name="${escape(normalizeLinefeeds(t))}"`+`\r\n\r\n${normalizeLinefeeds(i)}\r\n`);s.push(e);u+=e.byteLength}else{const e=R.encode(`${A}; name="${escape(normalizeLinefeeds(t))}"`+(i.name?`; filename="${escape(i.name)}"`:"")+"\r\n"+`Content-Type: ${i.type||"application/octet-stream"}\r\n\r\n`);s.push(e,i,r);if(typeof i.size==="number"){u+=e.byteLength+i.size+r.byteLength}else{n=true}}}const i=R.encode(`--${t}--`);s.push(i);u+=i.byteLength;if(n){u=null}l=e;c=async function*(){for(const e of s){if(e.stream){yield*e.stream()}else{yield e}}};g="multipart/form-data; boundary="+t}else if(i(e)){l=e;u=e.size;if(e.type){g=e.type}}else if(typeof e[Symbol.asyncIterator]==="function"){if(t){throw new TypeError("keepalive")}if(r.isDisturbed(e)||e.locked){throw new TypeError("Response body object should not be disturbed or locked")}s=e instanceof b?e:n(e)}if(typeof l==="string"||r.isBuffer(l)){u=Buffer.byteLength(l)}if(c!=null){let t;s=new b({async start(){t=c(e)[Symbol.asyncIterator]()},async pull(e){const{value:A,done:r}=await t.next();if(r){queueMicrotask((()=>{e.close()}))}else{if(!B(s)){e.enqueue(new Uint8Array(A))}}return e.desiredSize>0},async cancel(e){await t.return()},type:undefined})}const h={stream:s,source:l,length:u};return[h,g]}function safelyExtractBody(e,t=false){if(!b){b=A(5356).ReadableStream}if(e instanceof b){I(!r.isDisturbed(e),"The body has already been consumed.");I(!e.locked,"The stream is locked.")}return extractBody(e,t)}function cloneBody(e){const[t,A]=e.stream.tee();const s=E(A,{transfer:[A]});const[,r]=s.tee();e.stream=t;return{stream:r,length:e.length,source:e.source}}async function*consumeBody(e){if(e){if(p(e)){yield e}else{const t=e.stream;if(r.isDisturbed(t)){throw new TypeError("The body has already been consumed.")}if(t.locked){throw new TypeError("The stream is locked.")}t[Q]=true;yield*t}}}function throwIfAborted(e){if(e.aborted){throw new d("The operation was aborted.","AbortError")}}function bodyMixinMethods(e){const t={blob(){return specConsumeBody(this,(e=>{let t=bodyMimeType(this);if(t==="failure"){t=""}else if(t){t=k(t)}return new f([e],{type:t})}),e)},arrayBuffer(){return specConsumeBody(this,(e=>new Uint8Array(e).buffer),e)},text(){return specConsumeBody(this,utf8DecodeBytes,e)},json(){return specConsumeBody(this,parseJSONFromBytes,e)},async formData(){h.brandCheck(this,e);throwIfAborted(this[g]);const t=this.headers.get("Content-Type");if(/multipart\/form-data/.test(t)){const e={};for(const[t,A]of this.headers)e[t.toLowerCase()]=A;const t=new u;let A;try{A=new s({headers:e,preservePath:true})}catch(e){throw new d(`${e}`,"AbortError")}A.on("field",((e,A)=>{t.append(e,A)}));A.on("file",((e,A,s,r,n)=>{const i=[];if(r==="base64"||r.toLowerCase()==="base64"){let r="";A.on("data",(e=>{r+=e.toString().replace(/[\r\n]/gm,"");const t=r.length-r.length%4;i.push(Buffer.from(r.slice(0,t),"base64"));r=r.slice(t)}));A.on("end",(()=>{i.push(Buffer.from(r,"base64"));t.append(e,new D(i,s,{type:n}))}))}else{A.on("data",(e=>{i.push(e)}));A.on("end",(()=>{t.append(e,new D(i,s,{type:n}))}))}}));const r=new Promise(((e,t)=>{A.on("finish",e);A.on("error",(e=>t(new TypeError(e))))}));if(this.body!==null)for await(const e of consumeBody(this[g].body))A.write(e);A.end();await r;return t}else if(/application\/x-www-form-urlencoded/.test(t)){let e;try{let t="";const A=new TextDecoder("utf-8",{ignoreBOM:true});for await(const e of consumeBody(this[g].body)){if(!p(e)){throw new TypeError("Expected Uint8Array chunk")}t+=A.decode(e,{stream:true})}t+=A.decode();e=new URLSearchParams(t)}catch(e){throw Object.assign(new TypeError,{cause:e})}const t=new u;for(const[A,s]of e){t.append(A,s)}return t}else{await Promise.resolve();throwIfAborted(this[g]);throw h.errors.exception({header:`${e.name}.formData`,message:"Could not parse content as FormData."})}}};return t}function mixinBody(e){Object.assign(e.prototype,bodyMixinMethods(e))}async function specConsumeBody(e,t,A){h.brandCheck(e,A);throwIfAborted(e[g]);if(bodyUnusable(e[g].body)){throw new TypeError("Body is unusable")}const s=c();const errorSteps=e=>s.reject(e);const successSteps=e=>{try{s.resolve(t(e))}catch(e){errorSteps(e)}};if(e[g].body==null){successSteps(new Uint8Array);return s.promise}await l(e[g].body,successSteps,errorSteps);return s.promise}function bodyUnusable(e){return e!=null&&(e.stream.locked||r.isDisturbed(e.stream))}function utf8DecodeBytes(e){if(e.length===0){return""}if(e[0]===239&&e[1]===187&&e[2]===191){e=e.subarray(3)}const t=S.decode(e);return t}function parseJSONFromBytes(e){return JSON.parse(utf8DecodeBytes(e))}function bodyMimeType(e){const{headersList:t}=e[g];const A=t.get("content-Line truncated
/*! ws. MIT License. Einar Otto Stangvik <[email protected]> */n[r-4]=this.maskKey[0];n[r-3]=this.maskKey[1];n[r-2]=this.maskKey[2];n[r-1]=this.maskKey[3];n[1]=A;if(A===126){n.writeUInt16BE(t,2)}else if(A===127){n[2]=n[3]=0;n.writeUIntBE(t,4,6)}n[1]|=128;for(let e=0;e<t;e++){n[r+e]=this.frameData[e]^this.maskKey[e%4]}return n}}e.exports={WebsocketFrameSend:WebsocketFrameSend}},8634:(e,t,A)=>{"use strict";const{Writable:s}=A(2781);const r=A(7643);const{parserStates:n,opcodes:i,states:o,emptyBuffer:a}=A(1937);const{kReadyState:c,kSentClose:l,kResponse:u,kReceivedClose:g}=A(2319);const{isValidStatusCode:h,failWebsocketConnection:d,websocketMessageReceived:E}=A(865);const{WebsocketFrameSend:f}=A(7825);const C={};C.ping=r.channel("undici:websocket:ping");C.pong=r.channel("undici:websocket:pong");class ByteParser extends s{#i=[];#o=0;#a=n.INFO;#c={};#l=[];constructor(e){super();this.ws=e}_write(e,t,A){this.#i.push(e);this.#o+=e.length;this.run(A)}run(e){while(true){if(this.#a===n.INFO){if(this.#o<2){return e()}const t=this.consume(2);this.#c.fin=(t[0]&128)!==0;this.#c.opcode=t[0]&15;this.#c.originalOpcode??=this.#c.opcode;this.#c.fragmented=!this.#c.fin&&this.#c.opcode!==i.CONTINUATION;if(this.#c.fragmented&&this.#c.opcode!==i.BINARY&&this.#c.opcode!==i.TEXT){d(this.ws,"Invalid frame type was fragmented.");return}const A=t[1]&127;if(A<=125){this.#c.payloadLength=A;this.#a=n.READ_DATA}else if(A===126){this.#a=n.PAYLOADLENGTH_16}else if(A===127){this.#a=n.PAYLOADLENGTH_64}if(this.#c.fragmented&&A>125){d(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#c.opcode===i.PING||this.#c.opcode===i.PONG||this.#c.opcode===i.CLOSE)&&A>125){d(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#c.opcode===i.CLOSE){if(A===1){d(this.ws,"Received close frame with a 1-byte body.");return}const e=this.consume(A);this.#c.closeInfo=this.parseCloseBody(false,e);if(!this.ws[l]){const e=Buffer.allocUnsafe(2);e.writeUInt16BE(this.#c.closeInfo.code,0);const t=new f(e);this.ws[u].socket.write(t.createFrame(i.CLOSE),(e=>{if(!e){this.ws[l]=true}}))}this.ws[c]=o.CLOSING;this.ws[g]=true;this.end();return}else if(this.#c.opcode===i.PING){const t=this.consume(A);if(!this.ws[g]){const e=new f(t);this.ws[u].socket.write(e.createFrame(i.PONG));if(C.ping.hasSubscribers){C.ping.publish({payload:t})}}this.#a=n.INFO;if(this.#o>0){continue}else{e();return}}else if(this.#c.opcode===i.PONG){const t=this.consume(A);if(C.pong.hasSubscribers){C.pong.publish({payload:t})}if(this.#o>0){continue}else{e();return}}}else if(this.#a===n.PAYLOADLENGTH_16){if(this.#o<2){return e()}const t=this.consume(2);this.#c.payloadLength=t.readUInt16BE(0);this.#a=n.READ_DATA}else if(this.#a===n.PAYLOADLENGTH_64){if(this.#o<8){return e()}const t=this.consume(8);const A=t.readUInt32BE(0);if(A>2**31-1){d(this.ws,"Received payload length > 2^31 bytes.");return}const s=t.readUInt32BE(4);this.#c.payloadLength=(A<<8)+s;this.#a=n.READ_DATA}else if(this.#a===n.READ_DATA){if(this.#o<this.#c.payloadLength){return e()}else if(this.#o>=this.#c.payloadLength){const e=this.consume(this.#c.payloadLength);this.#l.push(e);if(!this.#c.fragmented||this.#c.fin&&this.#c.opcode===i.CONTINUATION){const e=Buffer.concat(this.#l);E(this.ws,this.#c.originalOpcode,e);this.#c={};this.#l.length=0}this.#a=n.INFO}}if(this.#o>0){continue}else{e();break}}}consume(e){if(e>this.#o){return null}else if(e===0){return a}if(this.#i[0].length===e){this.#o-=this.#i[0].length;return this.#i.shift()}const t=Buffer.allocUnsafe(e);let A=0;while(A!==e){const s=this.#i[0];const{length:r}=s;if(r+A===e){t.set(this.#i.shift(),A);break}else if(r+A>e){t.set(s.subarray(0,e-A),A);this.#i[0]=s.subarray(e-A);break}else{t.set(this.#i.shift(),A);A+=s.length}}this.#o-=e;return t}parseCloseBody(e,t){let A;if(t.length>=2){A=t.readUInt16BE(0)}if(e){if(!h(A)){return null}return{code:A}}let s=t.subarray(2);if(s[0]===239&&s[1]===187&&s[2]===191){s=s.subarray(3)}if(A!==undefined&&!h(A)){return null}try{s=new TextDecoder("utf-8",{fatal:true}).decode(s)}catch{return null}return{code:A,reason:s}}get closingInfo(){return this.#c.closeInfo}}e.exports={ByteParser:ByteParser}},2319:e=>{"use strict";e.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}},865:(e,t,A)=>{"use strict";const{kReadyState:s,kController:r,kResponse:n,kBinaryType:i,kWebSocketURL:o}=A(2319);const{states:a,opcodes:c}=A(1937);const{MessageEvent:l,ErrorEvent:u}=A(5310);function isEstablished(e){return e[s]===a.OPEN}function isClosing(e){return e[s]===a.CLOSING}function isClosed(e){return e[s]===a.CLOSED}function fireEvent(e,t,A=Event,s){const r=new A(e,s);t.dispatchEvent(r)}function websocketMessageReceived(e,t,A){if(e[s]!==a.OPEN){return}let r;if(t===c.TEXT){try{r=new TextDecoder("utf-8",{fatal:true}).decode(A)}cLine truncated
+220780
View File
File diff suppressed because it is too large. Load diff
+16625
View File
File diff suppressed because it is too large. Load diff
+14 -14
View File
@@ -1,25 +1,25 @@
{
"private": true,
"scripts": {
"build:schemas": "ts-schema-autogen generate",
"build:ncc": "ncc build --minify --no-source-map-register --no-cache dist/tsc/index.js --out dist/",
"build": "pnpm run build:schemas && tsc && pnpm run build:ncc",
"start": "pnpm run build && sh ./run.sh"
"build": "tsc && pnpm run build:ncc",
"start": "pnpm run build && sh ./run.sh",
"update-pnpm-dist": "pnpm install && cp ./node_modules/pnpm/dist/pnpm.cjs ./dist/pnpm.cjs && cp ./node_modules/pnpm/dist/worker.js ./dist/worker.js"
},
"dependencies": {
"node-fetch": "^2.6.1",
"@actions/core": "^1.10.1",
"@types/expand-tilde": "^2.0.2",
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.11.5",
"@types/node-fetch": "^2.6.11",
"expand-tilde": "^2.0.2",
"js-yaml": "^3.14.0",
"ajv": "^6.12.5",
"@actions/core": "^1.2.6",
"@types/expand-tilde": "^2.0.0",
"@types/node-fetch": "^2.5.7",
"@types/js-yaml": "^3.12.5",
"@types/node": "^14.11.2"
"fs-extra": "^11.2.0",
"yaml": "^2.3.4",
"zod": "^3.22.4"
},
"devDependencies": {
"typescript": "^4.0.3",
"@ts-schema-autogen/cli": "^0.1.2",
"@zeit/ncc": "^0.22.3"
"@vercel/ncc": "^0.38.1",
"pnpm": "^8.14.3",
"typescript": "^5.3.3"
}
}
+191 -799
View File
File diff suppressed because it is too large. Load diff
+4
View File
@@ -1,6 +1,10 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"pinVersions": false,
"extends": [
"config:base"
],
"ignoreDeps": [
"ajv"
]
}
+1 -2
View File
@@ -3,7 +3,6 @@
export HOME="$(pwd)"
export INPUT_VERSION=4.11.1
export INPUT_DEST='~/pnpm.temp'
export INPUT_BIN_DEST='~/pnpm.temp/.bin'
export INPUT_REGISTRY=https://registry.npmjs.com
export INPUT_RUN_INSTALL=null
export INPUT_standalone=false
exec node dist/index.js
+1 -1
View File
@@ -1,7 +1,7 @@
import { setFailed, saveState, getState } from '@actions/core'
import getInputs from './inputs'
import setOutputs from './outputs'
import installPnpm from './install-pnpm'
import setOutputs from './outputs'
import pnpmInstall from './pnpm-install'
import pruneStore from './pnpm-store-prune'
+7 -7
View File
@@ -1,13 +1,13 @@
import { getInput, InputOptions } from '@actions/core'
import { getBooleanInput, getInput, InputOptions } from '@actions/core'
import expandTilde from 'expand-tilde'
import { RunInstall, parseRunInstall } from './run-install'
export interface Inputs {
readonly version: string
readonly version?: string
readonly dest: string
readonly binDest: string
readonly registry: string
readonly runInstall: RunInstall[]
readonly packageJsonFile: string
readonly standalone: boolean
}
const options: InputOptions = {
@@ -17,11 +17,11 @@ const options: InputOptions = {
const parseInputPath = (name: string) => expandTilde(getInput(name, options))
export const getInputs = (): Inputs => ({
version: getInput('version', options),
version: getInput('version'),
dest: parseInputPath('dest'),
binDest: parseInputPath('bin_dest'),
registry: getInput('registry', options),
runInstall: parseRunInstall('run_install'),
packageJsonFile: parseInputPath('package_json_file'),
standalone: getBooleanInput('standalone'),
})
export default getInputs
@@ -1,21 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/ksxnodeapps/ts-schema-autogen/master/packages/schemas/config.schema.json",
"instruction": {
"compilerOptions": {
"strict": true,
"target": "ES2018",
"lib": [
"ES2018",
"ES2019",
"ES2020",
"ESNext"
],
"moduleResolution": "Node",
"esModuleInterop": true,
"resolveJsonModule": true
},
"input": "run-install.ts",
"symbol": "RunInstallInput",
"output": "run-install-input.schema.json"
}
}
-39
View File
@@ -1,39 +0,0 @@
{
"anyOf": [
{
"$ref": "#/definitions/RunInstall"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/RunInstall"
}
},
{
"type": [
"null",
"boolean"
]
}
],
"definitions": {
"RunInstall": {
"type": "object",
"properties": {
"recursive": {
"type": "boolean"
},
"cwd": {
"type": "string"
},
"args": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
+34 -33
View File
@@ -1,40 +1,41 @@
import process from 'process'
import { safeLoad } from 'js-yaml'
import Ajv from 'ajv'
import { getInput, error, InputOptions } from '@actions/core'
import runInstallSchema from './run-install-input.schema.json'
import { getInput, error } from '@actions/core'
import * as yaml from 'yaml'
import { z, ZodError } from 'zod'
export interface RunInstall {
readonly recursive?: boolean
readonly cwd?: string
readonly args?: readonly string[]
}
const RunInstallSchema = z.object({
recursive: z.boolean().optional(),
cwd: z.string().optional(),
args: z.array(z.string()).optional(),
})
export type RunInstallInput =
| null
| boolean
| RunInstall
| RunInstall[]
const RunInstallInputSchema = z.union([
z.null(),
z.boolean(),
RunInstallSchema,
z.array(RunInstallSchema),
])
const options: InputOptions = {
required: true,
}
export type RunInstallInput = z.infer<typeof RunInstallInputSchema>
export type RunInstall = z.infer<typeof RunInstallSchema>
export function parseRunInstall(name: string): RunInstall[] {
const result: RunInstallInput = safeLoad(getInput(name, options)) as any
const ajv = new Ajv({
allErrors: true,
async: false,
})
const validate = ajv.compile(runInstallSchema)
if (!validate(result)) {
for (const errorItem of validate.errors!) {
error(`with.run_install${errorItem.dataPath}: ${errorItem.message}`)
export function parseRunInstall(inputName: string): RunInstall[] {
const input = getInput(inputName, { required: true })
const parsedInput: unknown = yaml.parse(input)
try {
const result: RunInstallInput = RunInstallInputSchema.parse(parsedInput)
if (!result) return []
if (result === true) return [{ recursive: true }]
if (Array.isArray(result)) return result
return [result]
} catch (exception: unknown) {
error(`Error for input "${inputName}" = ${input}`)
if (exception instanceof ZodError) {
error(`Errors: ${exception.errors}`)
} else {
error(`Exception: ${exception}`)
}
return process.exit(1)
process.exit(1)
}
if (!result) return []
if (result === true) return [{ recursive: true }]
if (Array.isArray(result)) return result
return [result]
}
+1 -1
View File
@@ -9,7 +9,7 @@ export async function install(inputs: Inputs) {
const status = await runSelfInstaller(inputs)
endGroup()
if (status) {
return setFailed(`Something does wrong, self-installer exits with code ${status}`)
return setFailed(`Something went wrong, self-installer exits with code ${status}`)
}
}
+58 -12
View File
@@ -1,26 +1,72 @@
import { addPath, exportVariable } from '@actions/core'
import { spawn } from 'child_process'
import { remove, ensureFile, writeFile, readFile } from 'fs-extra'
import path from 'path'
import { execPath } from 'process'
import { downloadSelfInstaller } from '../self-installer'
import { Inputs } from '../inputs'
export async function runSelfInstaller(inputs: Inputs): Promise<number> {
const cp = spawn(execPath, {
env: {
PNPM_VERSION: inputs.version,
PNPM_DEST: inputs.dest,
PNPM_BIN_DEST: inputs.binDest,
PNPM_REGISTRY: inputs.registry,
},
const { version, dest, packageJsonFile, standalone } = inputs
// prepare self install
await remove(dest)
const pkgJson = path.join(dest, 'package.json')
await ensureFile(pkgJson)
await writeFile(pkgJson, JSON.stringify({ private: true }))
// prepare target pnpm
const target = await readTarget({ version, packageJsonFile, standalone })
const cp = spawn(execPath, [path.join(__dirname, 'pnpm.cjs'), 'install', target, '--no-lockfile'], {
cwd: dest,
stdio: ['pipe', 'inherit', 'inherit'],
})
const response = await downloadSelfInstaller()
response.body.pipe(cp.stdin)
return new Promise((resolve, reject) => {
const exitCode = await new Promise<number>((resolve, reject) => {
cp.on('error', reject)
cp.on('close', resolve)
})
if (exitCode === 0) {
const pnpmHome = path.join(dest, 'node_modules/.bin')
addPath(pnpmHome)
exportVariable('PNPM_HOME', pnpmHome)
}
return exitCode
}
async function readTarget(opts: {
readonly version?: string | undefined
readonly packageJsonFile: string
readonly standalone: boolean
}) {
const { version, packageJsonFile, standalone } = opts
if (version) return `${ standalone ? '@pnpm/exe' : 'pnpm' }@${version}`
const { GITHUB_WORKSPACE } = process.env
if (!GITHUB_WORKSPACE) {
throw new Error(`No workspace is found.
If you're intended to let pnpm/action-setup read preferred pnpm version from the "packageManager" field in the package.json file,
please run the actions/checkout before pnpm/action-setup.
Otherwise, please specify the pnpm version in the action configuration.`)
}
const { packageManager } = JSON.parse(await readFile(path.join(GITHUB_WORKSPACE, packageJsonFile), 'utf8'))
if (typeof packageManager !== 'string') {
throw new Error(`No pnpm version is specified.
Please specify it by one of the following ways:
- in the GitHub Action config with the key "version"
- in the package.json with the key "packageManager"`)
}
if (!packageManager.startsWith('pnpm@')) {
throw new Error('Invalid packageManager field in package.json')
}
if(standalone){
return packageManager.replace('pnpm@', '@pnpm/exe@')
}
return packageManager
}
export default runSelfInstaller
+4 -2
View File
@@ -1,10 +1,12 @@
import { setOutput, addPath } from '@actions/core'
import { Inputs } from '../inputs'
import { getBinDest } from '../utils'
export function setOutputs(inputs: Inputs) {
addPath(inputs.binDest)
const binDest = getBinDest(inputs)
addPath(binDest)
setOutput('dest', inputs.dest)
setOutput('bin_dest', inputs.binDest)
setOutput('bin_dest', binDest)
}
export default setOutputs
+1 -1
View File
@@ -1,5 +1,5 @@
import { spawnSync } from 'child_process'
import { setFailed, startGroup, endGroup } from '@actions/core'
import { spawnSync } from 'child_process'
import { Inputs } from '../inputs'
import { patchPnpmEnv } from '../utils'
+2 -2
View File
@@ -1,5 +1,5 @@
import { spawnSync } from 'child_process'
import { warning, startGroup, endGroup } from '@actions/core'
import { spawnSync } from 'child_process'
import { Inputs } from '../inputs'
import { patchPnpmEnv } from '../utils'
@@ -13,7 +13,7 @@ export function pruneStore(inputs: Inputs) {
const { error, status } = spawnSync('pnpm', ['store', 'prune'], {
stdio: 'inherit',
shell: true,
env: patchPnpmEnv(inputs)
env: patchPnpmEnv(inputs),
})
endGroup()
-4
View File
@@ -1,4 +0,0 @@
import fetch from 'node-fetch'
import url from './url'
export const downloadSelfInstaller = () => fetch(url)
export default downloadSelfInstaller
-2
View File
@@ -1,2 +0,0 @@
export * from './url'
export * from './download'
-3
View File
@@ -1,3 +0,0 @@
export const ref = '301414cec74a2b6b63c95b42f2ad1790ccb980ed'
export const url = `https://raw.githubusercontent.com/pnpm/self-installer/${ref}/install.js`
export default url
+4 -2
View File
@@ -1,8 +1,10 @@
import process from 'process'
import path from 'path'
import process from 'process'
import { Inputs } from '../inputs'
export const getBinDest = (inputs: Inputs): string => path.join(inputs.dest, 'node_modules', '.bin')
export const patchPnpmEnv = (inputs: Inputs): NodeJS.ProcessEnv => ({
...process.env,
PATH: inputs.binDest + path.delimiter + process.env.PATH
PATH: getBinDest(inputs) + path.delimiter + process.env.PATH,
})
+3 -7
View File
@@ -1,15 +1,11 @@
{
"compilerOptions": {
"target": "ES2018",
"module": "CommonJS",
"moduleResolution": "Node",
"target": "ES2022",
"module": "Node16",
"resolveJsonModule": true,
"lib": [
"ES2018",
"ES2019",
"ES2020",
"ESNext"
"ES2023"
],
"outDir": "./dist/tsc",
"preserveConstEnums": true,