Skip to content

Commit 5d3c356

Browse files
committed
Add dry-run option
1 parent bea5cda commit 5d3c356

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ inputs:
3030
description: Show verbose output.
3131
required: false
3232
default: false
33+
dry_run:
34+
description: Do not actually upload the packages.
35+
required: false
36+
default: false
3337
branding:
3438
color: yellow
3539
icon: upload-cloud
@@ -44,3 +48,4 @@ runs:
4448
- ${{ inputs.verify_metadata }}
4549
- ${{ inputs.skip_existing }}
4650
- ${{ inputs.verbose }}
51+
- ${{ inputs.dry_run }}

twine-upload.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -Eeuo pipefail
33

44

5-
if [[
5+
if [[ ${INPUT_DRY_RUN,,} != "true" ]] && [[
66
"$INPUT_USER" == "__token__" &&
77
! "$INPUT_PASSWORD" =~ ^pypi-
88
]]
@@ -35,6 +35,10 @@ if [[ ${INPUT_VERIFY_METADATA,,} != "false" ]] ; then
3535
twine check ${INPUT_PACKAGES_DIR%%/}/*
3636
fi
3737

38+
if [[ ${INPUT_DRY_RUN,,} != "false" ]] ; then
39+
exit 0
40+
fi
41+
3842
TWINE_EXTRA_ARGS=
3943
if [[ ${INPUT_SKIP_EXISTING,,} != "false" ]] ; then
4044
TWINE_EXTRA_ARGS=--skip-existing

0 commit comments

Comments
 (0)