1
0
mirror of https://github.com/pnpm/action-setup.git synced 2026-07-08 17:43:45 +08:00

Compare commits

..

4 Commits

Author SHA1 Message Date
khai96_
8aea7c7d41 chore(git): merge from master 2025-12-06 11:18:21 +07:00
khai96_
2502eaa221 style: no star imports 2025-12-06 11:17:32 +07:00
khai96_
f6cc97e7f4 style: format
* no semicolons
* no star imports
* import order
2025-12-06 11:09:20 +07:00
Jeremiasz Major
0bc9da32cd add pnpm store caching 2025-11-02 12:50:59 +01:00
4 changed files with 11 additions and 11 deletions

View File

@@ -22,7 +22,7 @@ jobs:
- windows-latest - windows-latest
steps: steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - uses: actions/checkout@v4
- name: Run the action - name: Run the action
uses: ./ uses: ./
@@ -51,7 +51,7 @@ jobs:
- windows-latest - windows-latest
steps: steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - uses: actions/checkout@v4
- name: Run the action - name: Run the action
uses: ./ uses: ./
@@ -74,8 +74,8 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: os:
# macos is excluded from this test because node 12 is no longer available on this platform
- ubuntu-latest - ubuntu-latest
- macos-latest
- windows-latest - windows-latest
standalone: standalone:
@@ -83,7 +83,7 @@ jobs:
- false - false
steps: steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - uses: actions/checkout@v4
- name: Run the action - name: Run the action
uses: ./ uses: ./
@@ -92,7 +92,7 @@ jobs:
standalone: ${{ matrix.standalone }} standalone: ${{ matrix.standalone }}
- name: install Node.js - name: install Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 uses: actions/setup-node@v4
with: with:
# pnpm@7.0.0 is not compatible with Node.js 12 # pnpm@7.0.0 is not compatible with Node.js 12
node-version: 12.22.12 node-version: 12.22.12
@@ -160,7 +160,7 @@ jobs:
- yarn - yarn
steps: steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - uses: actions/checkout@v4
- name: Run the action - name: Run the action
uses: ./ uses: ./

View File

@@ -24,7 +24,7 @@ inputs:
required: false required: false
default: 'pnpm-lock.yaml' default: 'pnpm-lock.yaml'
package_json_file: package_json_file:
description: File path to the package.json to read "packageManager" configuration. This path must be relative to the repository root (GITHUB_WORKSPACE). description: File path to the package.json to read "packageManager" configuration
required: false required: false
default: 'package.json' default: 'package.json'
standalone: standalone:

View File

@@ -1,5 +1,5 @@
import { getInput, error } from '@actions/core' import { getInput, error } from '@actions/core'
import { parse as parseYaml } from 'yaml' import * as yaml from 'yaml'
import { z, ZodError } from 'zod' import { z, ZodError } from 'zod'
const RunInstallSchema = z.object({ const RunInstallSchema = z.object({
@@ -20,7 +20,7 @@ export type RunInstall = z.infer<typeof RunInstallSchema>
export function parseRunInstall(inputName: string): RunInstall[] { export function parseRunInstall(inputName: string): RunInstall[] {
const input = getInput(inputName, { required: true }) const input = getInput(inputName, { required: true })
const parsedInput: unknown = parseYaml(input) const parsedInput: unknown = yaml.parse(input)
try { try {
const result: RunInstallInput = RunInstallInputSchema.parse(parsedInput) const result: RunInstallInput = RunInstallInputSchema.parse(parsedInput)

View File

@@ -6,7 +6,7 @@ import path from 'path'
import { execPath } from 'process' import { execPath } from 'process'
import util from 'util' import util from 'util'
import { Inputs } from '../inputs' import { Inputs } from '../inputs'
import { parse as parseYaml } from 'yaml' import YAML from 'yaml'
export async function runSelfInstaller(inputs: Inputs): Promise<number> { export async function runSelfInstaller(inputs: Inputs): Promise<number> {
const { version, dest, packageJsonFile, standalone } = inputs const { version, dest, packageJsonFile, standalone } = inputs
@@ -63,7 +63,7 @@ async function readTarget(opts: {
try { try {
const content = readFileSync(path.join(GITHUB_WORKSPACE, packageJsonFile), 'utf8'); const content = readFileSync(path.join(GITHUB_WORKSPACE, packageJsonFile), 'utf8');
({ packageManager } = packageJsonFile.endsWith(".yaml") ({ packageManager } = packageJsonFile.endsWith(".yaml")
? parseYaml(content, { merge: true }) ? YAML.parse(content, { merge: true })
: JSON.parse(content) : JSON.parse(content)
) )
} catch (error: unknown) { } catch (error: unknown) {