Skip to content

Commit e82590f

Browse files
feat: add dry run to publish
1 parent 21e4a55 commit e82590f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
description: The working directory of the package, useful for monorepos
1212
default: .
1313
type: string
14+
dry-run:
15+
description: Dry run (no publish)
16+
type: boolean
17+
default: false
1418
secrets:
1519
NODE_AUTH_TOKEN:
1620
description: An authentication token for npm
@@ -85,9 +89,13 @@ jobs:
8589
- name: Check binaries
8690
run: tree
8791
working-directory: ${{inputs.directory}}
88-
- name: Publish to npm
89-
# TODO: add dry-run as a workflow input
92+
- name: Publish Dry Run
9093
run: pnpm publish --dry-run
94+
if: ${{ inputs.dry-run }}
95+
working-directory: ${{inputs.directory}}
96+
- name: Publish to npm
97+
run: pnpm publish
98+
if: ${{ !inputs.dry-run }}
9199
env:
92100
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
93101
working-directory: ${{inputs.directory}}

0 commit comments

Comments
 (0)