diff --git a/action.yml b/action.yml index c89cf54..92ad475 100644 --- a/action.yml +++ b/action.yml @@ -23,7 +23,10 @@ inputs: description: "Just install cr tool" required: false skip_packaging: - description: "skip the packaging option (do your custom packaging before running this action" + description: "Skip the packaging option (do your custom packaging before running this action" + required: false + skip_existing: + description: "Skip package upload if release exists" required: false runs: @@ -61,5 +64,9 @@ runs: args+=(--skip-packaging "${{ inputs.skip_packaging }}") fi + if [[ -n "${{ inputs.skip_existing }}" ]]; then + args+=(--skip-existing "${{ inputs.skip_existing }}") + fi + "$GITHUB_ACTION_PATH/cr.sh" "${args[@]}" shell: bash diff --git a/cr.sh b/cr.sh index f4f3877..defc771 100755 --- a/cr.sh +++ b/cr.sh @@ -33,6 +33,7 @@ Usage: $(basename "$0") -n, --install-dir The Path to install the cr tool -i, --install-only Just install the cr tool -s, --skip-packaging Skip the packaging step (run your own packaging before using the releaser) + --skip-existing Skip package upload if release exists EOF } @@ -45,6 +46,7 @@ main() { local install_dir= local install_only= local skip_packaging= + local skip_existing= parse_command_line "$@" @@ -171,6 +173,12 @@ parse_command_line() { shift fi ;; + --skip-existing) + if [[ -n "${2:-}" ]]; then + skip_existing="$2" + shift + fi + ;; *) break ;; @@ -272,6 +280,9 @@ release_charts() { if [[ -n "$config" ]]; then args+=(--config "$config") fi + if [[ -n "$skip_existing" ]]; then + args+=(--skip-existing) + fi echo 'Releasing charts...' cr upload "${args[@]}"