Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag skip-existing to skip upload if release exists #134

Merged
merged 2 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
mark_as_latest:
description: Mark the created GitHub release as 'latest'
Expand Down Expand Up @@ -65,6 +68,10 @@ runs:
args+=(--skip-packaging "${{ inputs.skip_packaging }}")
fi

if [[ -n "${{ inputs.skip_existing }}" ]]; then
args+=(--skip-existing "${{ inputs.skip_existing }}")
fi

if [[ -n "${{ inputs.mark_as_latest }}" ]]; then
args+=(--mark-as-latest "${{ inputs.mark_as_latest }}")
fi
Expand Down
11 changes: 11 additions & 0 deletions cr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Usage: $(basename "$0") <options>
-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
-l, --mark-as-latest Mark the created GitHub release as 'latest' (default: true)
EOF
}
Expand All @@ -46,6 +47,7 @@ main() {
local install_dir=
local install_only=
local skip_packaging=
local skip_existing=
local mark_as_latest=true

parse_command_line "$@"
Expand Down Expand Up @@ -173,6 +175,12 @@ parse_command_line() {
shift
fi
;;
--skip-existing)
if [[ -n "${2:-}" ]]; then
skip_existing="$2"
shift
fi
;;
-l|--mark-as-latest)
if [[ -n "${2:-}" ]]; then
mark_as_latest="$2"
Expand Down Expand Up @@ -280,6 +288,9 @@ release_charts() {
if [[ -n "$config" ]]; then
args+=(--config "$config")
fi
if [[ -n "$skip_existing" ]]; then
args+=(--skip-existing)
fi
if [[ "$mark_as_latest" = false ]]; then
args+=(--make-release-latest=false)
fi
Expand Down