Skip to content

Commit

Permalink
chore(ci): update Node.js to 22 and pnpm to 9 in CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Shuunen committed Dec 7, 2024
1 parent 3f177be commit bd8f39c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
version: 9

- name: Run check 👀
run: pnpm run check
4 changes: 2 additions & 2 deletions src/files/gh-workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class GithubWorkflowFile extends FileBase {
private checkPnpm() {
const hasPnpmStep = this.couldContains('a pnpm setup step', /pnpm\/action-setup/u)
if (!hasPnpmStep) return
const hasRecentVersion = this.shouldContains('a recent pnpm version 8 or 9', /uses: pnpm\/action-setup@v\d\n +with:\n +version: [8|9]/u, 1, false, undefined, true)
const hasRecentVersion = this.couldContains('a recent pnpm version', /uses: pnpm\/action-setup@v\d\n +with:\n +version: 9/u, 1, undefined, true)
if (!hasRecentVersion && this.canFix) this.fileContent = this.fileContent.replace(/(?<step>uses: pnpm\/action-setup@v\d\n +with:\n +version:) \d/u, '$<step> 9')
const hasNoFrozenFlag = this.shouldContains('no frozen lockfile flag', /--no-frozen-lockfile/u, 0, false, undefined, true)
if (!hasNoFrozenFlag && this.canFix) this.fileContent = this.fileContent.replace(' --no-frozen-lockfile', '')
Expand All @@ -37,7 +37,7 @@ export class GithubWorkflowFile extends FileBase {
this.shouldContains('a node step in ci workflow', /actions\/setup-node/u)
this.checkPnpm()
this.couldContains('no main branch reference', /- main/u, 0)
this.couldContains('a recent node version', /node: \[2\d\]|node-version: 2\d/u, 1)
this.couldContains('a recent node version', /node: \[22\]|node-version: 22/u, 1)
}
}
/* c8 ignore stop */

0 comments on commit bd8f39c

Please sign in to comment.