Skip to content

Commit 658842a

Browse files
authored
Merge pull request #2615 from hey-api/ci/changesets-lock-file
ci: fix lockfile issue with changesets
2 parents fd01554 + 1c90f27 commit 658842a

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- uses: actions/setup-node@v4
3030
with:
3131
node-version: ${{ matrix.node-version }}
32-
cache: 'pnpm'
32+
cache: pnpm
3333

3434
- name: Install dependencies
3535
run: pnpm install

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- uses: actions/setup-node@v4
3131
with:
3232
node-version: ${{ matrix.node-version }}
33-
cache: 'pnpm'
33+
cache: pnpm
3434

3535
- name: Install dependencies
3636
run: pnpm install

.github/workflows/release.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ jobs:
3030
- uses: actions/setup-node@v4
3131
with:
3232
node-version: ${{ matrix.node-version }}
33-
cache: 'pnpm'
33+
cache: pnpm
3434

3535
- name: Install Dependencies
36-
run: pnpm install
36+
# prevent lockfile mismatch error
37+
run: pnpm install --frozen-lockfile
3738

3839
- name: Build
3940
run: pnpm build
@@ -56,3 +57,17 @@ jobs:
5657
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
5758
NPM_CONFIG_PROVENANCE: true
5859
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
60+
61+
- name: Get current branch
62+
run: echo "CURRENT_BRANCH=$(git branch --show-current)" >> $GITHUB_ENV
63+
64+
- name: Update lock file
65+
if: env.CURRENT_BRANCH == 'changeset-release/main'
66+
run: pnpm install --lockfile-only
67+
68+
- name: Commit lock file
69+
if: env.CURRENT_BRANCH == 'changeset-release/main'
70+
uses: stefanzweifel/[email protected]
71+
with:
72+
branch: ${{ env.CURRENT_BRANCH }}
73+
commit_message: 'chore: update lock file'

0 commit comments

Comments
 (0)