Skip to content

Commit fa90a32

Browse files
shenxianpengXianpeng Shen
authored and
Xianpeng Shen
committed
Support to disable progress bar
1 parent 3fbcf7c commit fa90a32

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,15 @@ It will show SHA256, MD5, BLAKE2-256 values of files to be uploaded.
222222
print-hash: true
223223
```
224224

225+
### Disable the progress bar
226+
227+
You may want to disable the progress bar when `twine upload`.
228+
229+
```yml
230+
with:
231+
disable-progress-bar: true
232+
```
233+
225234
### Specifying a different username
226235

227236
The default username value is `__token__`. If you publish to a custom

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ inputs:
8080
Use `print-hash` instead.
8181
required: false
8282
default: 'false'
83+
disable-progress-bar:
84+
description: Disable the progress bar.
85+
required: false
86+
default: 'true'
8387
branding:
8488
color: yellow
8589
icon: upload-cloud
@@ -95,3 +99,4 @@ runs:
9599
- ${{ inputs.skip-existing }}
96100
- ${{ inputs.verbose }}
97101
- ${{ inputs.print-hash }}
102+
- ${{ inputs.disable-progress-bar }}

twine-upload.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ INPUT_PACKAGES_DIR="$(get-normalized-input 'packages-dir')"
3939
INPUT_VERIFY_METADATA="$(get-normalized-input 'verify-metadata')"
4040
INPUT_SKIP_EXISTING="$(get-normalized-input 'skip-existing')"
4141
INPUT_PRINT_HASH="$(get-normalized-input 'print-hash')"
42+
INPUT_DISABLE_PROGRESS_BAR="$(get-normalized-input 'disable-progress-bar')"
4243

4344
PASSWORD_DEPRECATION_NUDGE="::error title=Password-based uploads deprecated::\
4445
Starting in 2024, PyPI will require all users to enable Two-Factor \
@@ -133,6 +134,10 @@ if [[ ${INPUT_PRINT_HASH,,} != "false" || ${INPUT_VERBOSE,,} != "false" ]] ; the
133134
python /app/print-hash.py ${INPUT_PACKAGES_DIR%%/}
134135
fi
135136

137+
if [[ ${INPUT_DISABLE_PROGRESS_BAR,,} != "false" ]]; then
138+
TWINE_EXTRA_ARGS="--disable-progress-bar $TWINE_EXTRA_ARGS"
139+
fi
140+
136141
TWINE_USERNAME="$INPUT_USER" \
137142
TWINE_PASSWORD="$INPUT_PASSWORD" \
138143
TWINE_REPOSITORY_URL="$INPUT_REPOSITORY_URL" \

0 commit comments

Comments
 (0)