Skip to content

Commit 0a1807d

Browse files
committed
Attempt to fix workflows
1 parent 1c9072e commit 0a1807d

File tree

3 files changed

+69
-78
lines changed

3 files changed

+69
-78
lines changed

.github/actions/setup-pnpm/action.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.

.github/workflows/socket-fix.yml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,39 @@ jobs:
2727
- name: Checkout repo
2828
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2929

30-
- name: Setup pnpm
31-
uses: ./.github/actions/setup-pnpm
30+
- name: Setup Node.js
31+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
3232
with:
3333
node-version: '22'
34-
pnpm-version: '^10.16.0'
35-
install-deps: 'true'
36-
socket-scan: 'false'
34+
35+
- name: Setup PNPM
36+
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
37+
with:
38+
version: '^10.16.0'
39+
40+
- name: Get pnpm store directory
41+
id: pnpm-cache
42+
shell: bash
43+
run: echo "store-path=$(pnpm store path)" >> $GITHUB_OUTPUT
44+
45+
- name: Generate cache prefix
46+
id: pnpm-timed-expiration
47+
shell: bash
48+
# Change cache prefix every 120 days.
49+
run: echo "prefix=$(( $(date +%s) / 60 / 60 / 24 / 120 ))" >> $GITHUB_OUTPUT
50+
51+
- name: Cache pnpm
52+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
53+
with:
54+
path: ${{ steps.pnpm-cache.outputs.store-path }}
55+
# Cache key based on pnpm-lock.yaml hash and timed prefix.
56+
key: ${{ runner.os }}-pnpm-store-${{ steps.pnpm-timed-expiration.outputs.prefix }}-${{ hashFiles('pnpm-lock.yaml') }}
57+
restore-keys: |
58+
${{ runner.os }}-pnpm-store-${{ steps.pnpm-timed-expiration.outputs.prefix }}-
59+
60+
- name: Install dependencies
61+
shell: bash
62+
run: pnpm install
3763

3864
- name: Run Socket Fix CLI
3965
env:

.github/workflows/test.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,46 @@ jobs:
2828
os: [ubuntu-latest, windows-latest]
2929
steps:
3030
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
31-
- name: Setup PNPM
32-
uses: ./.github/actions/setup-pnpm
31+
32+
- name: Setup Node.js
33+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
3334
with:
3435
node-version: ${{ matrix.node-version }}
35-
pnpm-version: '^10.16.0'
36+
37+
- name: Setup PNPM
38+
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
39+
with:
40+
version: '^10.16.0'
41+
42+
- name: Get pnpm store directory
43+
id: pnpm-cache
44+
shell: bash
45+
run: echo "store-path=$(pnpm store path)" >> $GITHUB_OUTPUT
46+
47+
- name: Generate cache prefix
48+
id: pnpm-timed-expiration
49+
shell: bash
50+
# Change cache prefix every 120 days.
51+
run: echo "prefix=$(( $(date +%s) / 60 / 60 / 24 / 120 ))" >> $GITHUB_OUTPUT
52+
53+
- name: Cache pnpm
54+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
55+
with:
56+
path: ${{ steps.pnpm-cache.outputs.store-path }}
57+
# Cache key based on pnpm-lock.yaml hash and timed prefix.
58+
key: ${{ runner.os }}-pnpm-store-${{ steps.pnpm-timed-expiration.outputs.prefix }}-${{ hashFiles('pnpm-lock.yaml') }}
59+
restore-keys: |
60+
${{ runner.os }}-pnpm-store-${{ steps.pnpm-timed-expiration.outputs.prefix }}-
61+
62+
- name: Socket security scan
63+
shell: bash
64+
run: pnpm dlx @socketsecurity/cli --config '{"settings":{"reportLevel":"error"}}' npm install --no-audit --no-fund --package-lock-only
65+
66+
- name: Install dependencies with pnpm
67+
shell: bash
68+
run: |
69+
rm -f package-lock.json
70+
pnpm install
3671
3772
- name: Run tests
3873
run: pnpm run test-ci

0 commit comments

Comments
 (0)