Skip to content

Commit cbd0367

Browse files
authored
Merge pull request #9 from pranamphd/improve-cd-publish-step
chore(cd): add missing PKG_VERSION variable and conditional --dry-run execution on test mode
2 parents 43cda50 + d8b9bc1 commit cbd0367

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/ts-cd.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,12 @@ jobs:
147147
--clobber
148148
149149
- name: Publish to npm (--dry-run)
150-
if: env.TEST_MODE != 'true'
150+
if: env.TEST_MODE == 'true'
151151
env:
152152
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
153153
run: |
154154
set -euo pipefail
155+
PKG_VERSION=$(node -p "require('./package.json').version")
155156
156157
if [[ "${PKG_VERSION}" == *"-alpha."* ]]; then
157158
npm publish --access public --tag alpha --dry-run
@@ -169,6 +170,8 @@ jobs:
169170
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
170171
run: |
171172
set -euo pipefail
173+
PKG_VERSION=$(node -p "require('./package.json').version")
174+
172175
if [[ "${PKG_VERSION}" == *"-alpha."* ]]; then
173176
npm publish --access public --tag alpha
174177
elif [[ "${PKG_VERSION}" == *"-beta."* ]]; then

0 commit comments

Comments
 (0)