Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

Commit 0f8a90b

Browse files
committed
Add support for dry-run when not main branch
1 parent cfa7b93 commit 0f8a90b

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# NOTE: See "prepublishOnly" script in package.json
21
# NPM_TOKEN will only be populated in the context of the `publish` GH environment, see L14
32

43
name: Publish to NPM
54

65
on:
76
push:
87
branches:
8+
- "**" # Run on all branches, but only publish from main
99
- "main"
1010

1111
jobs:
@@ -29,7 +29,7 @@ jobs:
2929
shell: bash
3030

3131
- name: Install dependencies
32-
run:
32+
run: |
3333
pnpm install --frozen-lockfile --strict-peer-dependencies --filter=ccip-js --filter=ccip-react-components
3434
shell: bash
3535

@@ -38,13 +38,23 @@ jobs:
3838
pnpm build-ccip-js
3939
cd packages/ccip-js
4040
pnpm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_CCIP_JS }}
41-
pnpm publish --no-git-checks --access public
41+
if [ "${GITHUB_REF_NAME}" != "main" ]; then
42+
echo "Running dry run on non-main branch"
43+
pnpm publish --no-git-checks --access public --dry-run
44+
else
45+
pnpm publish --no-git-checks --access public
46+
fi
4247
shell: bash
4348

4449
- name: Publish ccip-react-components to NPM
4550
run: |
4651
pnpm build-components
4752
cd packages/ccip-react-components
4853
pnpm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_CCIP_REACT_COMPONENTS }}
49-
pnpm publish --no-git-checks --access public
50-
shell: bash
54+
if [ "${GITHUB_REF_NAME}" != "main" ]; then
55+
echo "Running dry run on non-main branch"
56+
pnpm publish --no-git-checks --access public --dry-run
57+
else
58+
pnpm publish --no-git-checks --access public
59+
fi
60+
shell: bash

0 commit comments

Comments
 (0)