Skip to content

Commit d3e0e2d

Browse files
committed
ci: add path filters to publish-commit, upgrade actions and caching
publish-commit had no path/branch filters — fired on every push. Restricted to packages/**, upgraded checkout to v4, added pnpm cache and --frozen-lockfile to both publish workflows.
1 parent f546291 commit d3e0e2d

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

.github/workflows/publish-commit.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: 🚀 pkg-pr-new
2-
on: [push, pull_request]
2+
on:
3+
push:
4+
paths:
5+
- "packages/**"
6+
pull_request:
7+
paths:
8+
- "packages/**"
39

410
concurrency:
511
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
@@ -17,7 +23,7 @@ jobs:
1723

1824
steps:
1925
- name: Checkout code
20-
uses: actions/checkout@v2
26+
uses: actions/checkout@v4
2127

2228
- name: Install pnpm
2329
uses: pnpm/action-setup@v4
@@ -26,9 +32,11 @@ jobs:
2632
- uses: actions/setup-node@v4
2733
with:
2834
node-version-file: "package.json"
35+
cache: "pnpm"
36+
cache-dependency-path: "**/pnpm-lock.yaml"
2937

3038
- name: Install dependencies
31-
run: pnpm install
39+
run: pnpm install --frozen-lockfile
3240

3341
- name: Configure Nx Cloud environment
3442
run: |

.github/workflows/publish_custom-pre.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
timeout-minutes: 20
1515
steps:
1616
- name: Checkout Repo
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818

1919
- name: Setup pnpm
2020
uses: pnpm/action-setup@v4
@@ -25,12 +25,14 @@ jobs:
2525
uses: actions/setup-node@v4
2626
with:
2727
node-version: 20.x
28+
cache: "pnpm"
29+
cache-dependency-path: "**/pnpm-lock.yaml"
2830
registry-url: https://registry.npmjs.org
2931
env:
3032
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3133

3234
- name: Install Dependencies
33-
run: pnpm i
35+
run: pnpm install --frozen-lockfile
3436

3537
- name: Configure Nx Cloud environment
3638
run: |

0 commit comments

Comments
 (0)