Commit Graph

56 Commits

Author SHA1 Message Date
Zoltan Kochan
0ffe724fa5 feat: support standalone mode with @pnpm/exe bootstrap
- When standalone=true, bootstrap with @pnpm/exe via npm ci
- When standalone=false, bootstrap with pnpm via npm ci
- Both use pnpm self-update to reach the target version
- Remove --ignore-scripts from npm ci so @pnpm/exe install scripts run
- Add standalone test back to CI

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 02:29:31 +01:00
Zoltan Kochan
a722bd2d87 refactor: use pnpm self-update instead of installing target separately
- Bootstrap pnpm via npm ci (verified by lockfile)
- Use `pnpm self-update <version>` for explicit version
- Let pnpm handle packageManager field automatically
- Remove standalone/exe-specific install logic (pnpm handles this)
- Update tests to not run pnpm install against the action repo itself

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 02:24:28 +01:00
Zoltan Kochan
49b8837b49 fix: run bootstrap pnpm via node instead of bin shim
Use `node .../pnpm/bin/pnpm.cjs` to run the bootstrap pnpm, matching
the approach used by the old bundled pnpm.cjs. This avoids issues with
the .bin symlink on different platforms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 02:15:16 +01:00
Zoltan Kochan
9fbc6cd1d1 fix: use --no-lockfile for target install
--lockfile-dir pointing to GITHUB_WORKSPACE causes the bootstrap pnpm
to use the project's pnpm-lock.yaml (which tracks project deps, not
pnpm itself), corrupting the install. Revert to --no-lockfile for now.
Lockfile-based integrity verification can be added when pnpm v11 has
proper support for verifying the pnpm package itself.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 02:06:14 +01:00
Zoltan Kochan
af96d9fd0e fix: always use pnpm (not @pnpm/exe) for bootstrap and update lockfile
The bootstrap only needs regular pnpm to install the target package.
@pnpm/exe requires install scripts which we skip with --ignore-scripts.
Also regenerate pnpm-lock.yaml to match current package.json.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 02:02:44 +01:00
Zoltan Kochan
1fb299a44f fix: remove packageManager field and fix Windows npm spawn
- Remove packageManager from package.json to avoid version conflict
  when the action tests against itself (uses: ./)
- Use shell: true on Windows so spawn can find npm.cmd

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 01:58:24 +01:00
Zoltan Kochan
24a61aa18d fix: remove "type": "module" from package.json
Node.js treats dist/index.js as ESM due to "type": "module",
but the bundle uses CJS require() calls. Remove the field so
Node.js defaults to CJS for .js files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 01:55:56 +01:00
Zoltan Kochan
ab0b84aeb1 fix: bundle as CJS to support @actions/* packages
The @actions/* packages use CJS require() for Node.js builtins,
which fails with "Dynamic require of 'os' is not supported" when
bundled as ESM. Switch esbuild output to CJS format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 01:54:09 +01:00
Zoltan Kochan
dc312cdfd7 feat!: replace bundled pnpm binary with npm + lockfile bootstrap
Remove the 9MB bundled pnpm.cjs/worker.js and instead use npm ci with
committed package-lock.json files (~5KB) to install a bootstrap pnpm,
which then installs the target version with integrity verification via
the project's pnpm-lock.yaml.

Also switch from ncc to esbuild and modernize to ESM.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 01:52:34 +01:00
Jeremiasz Major
e94b270858 feat: store caching (#188)
* add pnpm store caching

* style: format

* no semicolons
* no star imports
* import order

* style: no star imports

---------

Co-authored-by: khai96_ <hvksmr1996@gmail.com>
2025-12-07 22:16:49 +01:00
Adrian Riedel
41ff726559 feat: support installation from custom NPM registry (#179)
copy .npmrc from GitHub workspace if it exists so that PNPM respects custom
registry configurations when self-installing
2025-10-08 10:48:14 +02:00
Zoltan Kochan
a7487c7e89 feat: update dist 2025-02-06 22:30:07 +01:00
Karl Horky
bee1f099e5 feat: throw error when multiple versions specified (#122)
* Throw error when multiple versions specified

* fix: fmt

* fix: fmt

* Swallow error on ENOENT

* Match versions

* refactor: install pnpm

---------

Co-authored-by: Khải <hvksmr1996@gmail.com>
Co-authored-by: Zoltan Kochan <z@kochan.io>
2024-05-06 23:24:46 +02:00
Sukka
ce859e384f refactor: replace fs-extra with Node.js built-in fs methods (#120) 2024-04-16 11:26:31 +02:00
Erik Burton
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 <z@kochan.io>
2024-02-08 11:22:15 +01:00
Khải
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 <takashi@tks.st>
2023-07-26 14:50:04 +03:00
Kengo TODA
b27f801bf9 feat: add package_json_file option
Signed-off-by: Kengo TODA <skypencil@gmail.com>
2023-07-08 07:02:46 +08: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
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
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
Zoltan Kochan
225f3bb4b0 build 2022-02-22 11:34:20 +02:00
khai96_
e7c10c6fc5 Update dist/index.js 2022-02-22 13:04:41 +07:00
Jack Works
1d51e20937 feat: try support packageManager 2022-02-22 12:26:05 +08:00
Zoltan Kochan
d8ea532ac4 fix: retry fetch of pnpm script
close #22
2022-02-20 21:49:26 +02:00
khai96_
394c848db6 Update the bundle 2022-02-08 19:50:57 +07: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
khai96_
7c4472dbcf Forgot to specify working directory 2021-03-23 12:48:54 +07:00
khai96_
aefcd1e623 Use pnpm.js to install pnpm 2021-03-23 12:42:43 +07:00
khai96_
3a2c7247e1 Fix js-yaml usage 2021-03-23 11:43:49 +07:00
khai96_
8e1abe543f Update dist/index.js 2020-10-05 21:51:43 +07:00
khai96_
83681c63a7 Make logs foldable 2020-05-09 21:50:47 +07:00
khai96_
b1febf84ed Fix pruneStore 2020-05-09 21:41:25 +07:00
khai96_
c8fc1974e1 Run pnpm store prune post action 2020-05-09 21:15:50 +07:00
khai96_
291e58ad85 Enable post action 2020-05-09 21:02:32 +07:00
khai96_
1790ca7f76 Add pnpm install 2020-05-09 20:24:52 +07:00
khai96_
9a1617cf46 Rename install to install-pnpm 2020-05-09 20:03:45 +07:00
khai96_
6fe65dc1af Move run-install to its own module 2020-05-09 20:01:25 +07:00
khai96_
91d3d73121 Correct validation error message 2020-05-09 19:52:48 +07:00
khai96_
e373fffa0a Use ajv to validate schema 2020-05-09 19:45:31 +07:00
khai96_
bb24f595c2 Add schema generator 2020-05-09 19:24:07 +07:00
khai96_
d44b8c5e53 Add run_install input 2020-05-09 19:13:46 +07:00
khai96_
4b13327683 Re-add dist/index.js 2020-05-09 18:27:15 +07:00
khai96_
49ba4cbc60 Delete dist/index.js 2020-05-09 18:26:16 +07:00
khai96_
9979c3d928 Use node-fetch 2020-05-08 21:34:25 +07:00
khai96_
7574328996 Forgot to update dist/index.js 2020-05-08 21:17:30 +07:00
khai96_
59a67d7671 Support tilde 2020-05-08 14:24:25 +07:00