Skip to content

Commit 2d6542b

Browse files
Add option to run release action as a dry run
1 parent f23336b commit 2d6542b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ on:
1515
description: "Prerelease tag (e.g. beta, alpha)"
1616
required: false
1717
type: string
18+
dry-run:
19+
description: 'Run the release without publishing for testing (set to "true")'
20+
required: false
21+
default: "false"
1822
concurrency:
1923
group: ${{ github.workflow }}
20-
run-name: "Release (increment: ${{ github.event.inputs.increment }}, prerelease: ${{ github.event.inputs.prerelease || 'none' }})"
24+
run-name: "Release (increment: ${{ github.event.inputs.increment }}, prerelease: ${{ github.event.inputs.prerelease || 'none' }}${{ github.event.inputs.dry-run == 'true' && ', dry run' || '' }})"
2125
jobs:
2226
release:
2327
runs-on: ubuntu-latest
@@ -49,6 +53,9 @@ jobs:
4953
if [[ -n "${{ github.event.inputs.prerelease }}" ]]; then
5054
ARGS+=" --preRelease=${{ github.event.inputs.prerelease }}"
5155
fi
56+
if [[ "${{ github.event.inputs.dry-run }}" == "true" ]]; then
57+
ARGS+=" --dry-run"
58+
fi
5259
npm run release -- $ARGS --ci
5360
env:
5461
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)