mirror of
https://github.com/pnpm/action-setup.git
synced 2026-07-14 18:03:44 +08:00
Compare commits
5 Commits
v4.0.0
...
7ce3debe10
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ce3debe10 | ||
|
|
b036c0dcb9 | ||
|
|
327b709af8 | ||
|
|
4504319403 | ||
|
|
1ecf7e8d5f |
@@ -72,7 +72,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: pnpm/action-setup@v4
|
||||
- uses: pnpm/action-setup@v3
|
||||
with:
|
||||
version: 8
|
||||
```
|
||||
@@ -91,7 +91,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
- uses: pnpm/action-setup@v3
|
||||
with:
|
||||
version: 8
|
||||
run_install: |
|
||||
@@ -120,7 +120,7 @@ jobs:
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
- uses: pnpm/action-setup@v3
|
||||
name: Install pnpm
|
||||
with:
|
||||
version: 8
|
||||
|
||||
8
dist/index.js
vendored
8
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,10 +1,8 @@
|
||||
import { addPath, exportVariable } from '@actions/core'
|
||||
import { spawn } from 'child_process'
|
||||
import { rm, writeFile, mkdir } from 'fs/promises'
|
||||
import { readFileSync } from 'fs'
|
||||
import { rm, writeFile, readFile, mkdir } from 'fs/promises'
|
||||
import path from 'path'
|
||||
import { execPath } from 'process'
|
||||
import util from 'util'
|
||||
import { Inputs } from '../inputs'
|
||||
|
||||
export async function runSelfInstaller(inputs: Inputs): Promise<number> {
|
||||
@@ -49,10 +47,10 @@ async function readTarget(opts: {
|
||||
|
||||
if (GITHUB_WORKSPACE) {
|
||||
try {
|
||||
({ packageManager } = JSON.parse(readFileSync(path.join(GITHUB_WORKSPACE, packageJsonFile), 'utf8')))
|
||||
} catch (error: unknown) {
|
||||
({ packageManager } = JSON.parse(await readFile(path.join(GITHUB_WORKSPACE, packageJsonFile), 'utf8')))
|
||||
} catch (error) {
|
||||
// Swallow error if package.json doesn't exist in root
|
||||
if (!util.types.isNativeError(error) || !('code' in error) || error.code !== 'ENOENT') throw error
|
||||
if (error.code !== 'ENOENT') throw error
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user