@@ -8,9 +8,9 @@ import { fileExists, diffTable, toBool, stripHash } from './utils.js';
8
8
/**
9
9
* @typedef {ReturnType<typeof import("@actions/github").getOctokit> } Octokit
10
10
* @typedef {typeof import("@actions/github").context } ActionContext
11
- * @param {Octokit } octokit
12
- * @param {ActionContext } context
13
- * @param {string } token
11
+ * @param {Octokit } octokit
12
+ * @param {ActionContext } context
13
+ * @param {string } token
14
14
*/
15
15
async function run ( octokit , context , token ) {
16
16
const { owner, repo, number : pull_number } = context . issue ;
@@ -51,13 +51,17 @@ async function run(octokit, context, token) {
51
51
const cwd = process . cwd ( ) ;
52
52
53
53
let yarnLock = await fileExists ( path . resolve ( cwd , 'yarn.lock' ) ) ;
54
+ let pnpmLock = await fileExists ( path . resolve ( cwd , 'pnpm-lock.yaml' ) ) ;
54
55
let packageLock = await fileExists ( path . resolve ( cwd , 'package-lock.json' ) ) ;
55
56
56
57
let npm = `npm` ;
57
58
let installScript = `npm install` ;
58
59
if ( yarnLock ) {
59
60
installScript = npm = `yarn --frozen-lockfile` ;
60
61
}
62
+ else if ( pnpmLock ) {
63
+ installScript = `pnpm install --frozen-lockfile` ;
64
+ }
61
65
else if ( packageLock ) {
62
66
installScript = `npm ci` ;
63
67
}
@@ -71,7 +75,7 @@ async function run(octokit, context, token) {
71
75
console . log ( `Building using ${ npm } run ${ buildScript } ` ) ;
72
76
await exec ( `${ npm } run ${ buildScript } ` ) ;
73
77
endGroup ( ) ;
74
-
78
+
75
79
// In case the build step alters a JSON-file, ....
76
80
await exec ( `git reset --hard` ) ;
77
81
@@ -117,11 +121,15 @@ async function run(octokit, context, token) {
117
121
startGroup ( `[base] Install Dependencies` ) ;
118
122
119
123
yarnLock = await fileExists ( path . resolve ( cwd , 'yarn.lock' ) ) ;
124
+ pnpmLock = await fileExists ( path . resolve ( cwd , 'pnpm-lock.yaml' ) ) ;
120
125
packageLock = await fileExists ( path . resolve ( cwd , 'package-lock.json' ) ) ;
121
-
126
+
122
127
if ( yarnLock ) {
123
128
installScript = npm = `yarn --frozen-lockfile` ;
124
129
}
130
+ else if ( pnpmLock ) {
131
+ installScript = `pnpm install --frozen-lockfile` ;
132
+ }
125
133
else if ( packageLock ) {
126
134
installScript = `npm ci` ;
127
135
}
@@ -256,8 +264,8 @@ async function run(octokit, context, token) {
256
264
257
265
/**
258
266
* Create a check and return a function that updates (completes) it
259
- * @param {Octokit } octokit
260
- * @param {ActionContext } context
267
+ * @param {Octokit } octokit
268
+ * @param {ActionContext } context
261
269
*/
262
270
async function createCheck ( octokit , context ) {
263
271
const check = await octokit . checks . create ( {
0 commit comments