Skip to content

Commit 9550418

Browse files
Copilotyanglbme
andcommitted
chore: update prettier workflow to use pnpm instead of npm
Co-authored-by: yanglbme <[email protected]>
1 parent d482269 commit 9550418

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/prettier.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
# ---------------------------------------------------------
1414
# SAFETY CHECK:
1515
# Only run for PRs from the SAME repository.
16-
# Fork PRs are skipped entirely to prevent RCE via npm install.
16+
# Fork PRs are skipped entirely to prevent RCE via pnpm install.
1717
# ---------------------------------------------------------
1818
if: ${{ github.event.pull_request.head.repo.fork == false }}
1919
permissions:
@@ -30,15 +30,19 @@ jobs:
3030
uses: actions/setup-node@v4
3131
with:
3232
node-version: 18
33+
- name: Install pnpm
34+
uses: pnpm/action-setup@v4
35+
with:
36+
version: 10.25.0
3337
- name: Install Dependencies
34-
run: npm install
38+
run: pnpm install
3539
- name: Run prettier
3640
run: |
3741
git config --global core.quotepath off
3842
changed_files=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" | grep -E '\.js$|\.ts$|\.php$|\.sql$|\.md$' || true)
3943
if [ -n "$changed_files" ]; then
4044
echo "Running prettier on the changed files"
41-
echo "$changed_files" | xargs -d '\n' npx prettier --write
45+
echo "$changed_files" | xargs -d '\n' pnpm exec prettier --write
4246
else
4347
echo "No matching files to run prettier on."
4448
fi

0 commit comments

Comments
 (0)