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

Compare commits

..

No commits in common. "b9e1dbc72ff7358f971cc0b7c62c7a0d83f1068b" and "e94b270858c939f4f8b43f5c1438fa1d9a67ad5d" have entirely different histories.

3 changed files with 5 additions and 5 deletions

View File

@ -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:

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) {