From 176ae50c06cccd3d21d66552b5f5579591ebf170 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 2 Jun 2020 11:08:43 -0400 Subject: [PATCH] feat: Add twine check before upload #30 --- README.md | 9 +++++++++ action.yml | 5 +++++ twine-upload.sh | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/README.md b/README.md index 4701f78..ae5b713 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,15 @@ would now look like: packages_dir: custom-dir/ ``` +### Disabling twine check + +You can also disable the twine check with: + +```yml + with: + check: false +``` + ## License The Dockerfile and associated scripts and documentation in this project diff --git a/action.yml b/action.yml index 478f53f..546e2ec 100644 --- a/action.yml +++ b/action.yml @@ -16,6 +16,10 @@ inputs: description: The target directory for distribution required: false default: dist + check: + description: Check before uploading + required: false + default: true branding: color: yellow icon: upload-cloud @@ -27,3 +31,4 @@ runs: - ${{ inputs.password }} - ${{ inputs.repository_url }} - ${{ inputs.packages_dir }} + - ${{ inputs.check }} diff --git a/twine-upload.sh b/twine-upload.sh index 5c3ca96..c1e88db 100755 --- a/twine-upload.sh +++ b/twine-upload.sh @@ -28,6 +28,10 @@ then are in place should you face this problem. fi +if [[ ${INPUT_CHECK,,} != "false" ]] ; then + exec twine check ${INPUT_PACKAGES_DIR%%/}/* +fi + TWINE_USERNAME="$INPUT_USER" \ TWINE_PASSWORD="$INPUT_PASSWORD" \