Add flag skip-existing to skip upload if release exists (#134)
* add skip-existing option Signed-off-by: Alexandre Nicolaie dit Clairville <alexandre.nicolaie@gmail.com> --------- Signed-off-by: Alexandre Nicolaie dit Clairville <alexandre.nicolaie@gmail.com> Signed-off-by: Alexandre NICOLAIE <xunleii@users.noreply.github.com> Co-authored-by: Carlos Tadeu Panato Junior <ctadeu@gmail.com>
This commit is contained in:
co-authored by
Carlos Tadeu Panato Junior
parent
db5211eb38
commit
5f8660e6e9
+8
-1
@@ -23,7 +23,10 @@ inputs:
|
|||||||
description: "Just install cr tool"
|
description: "Just install cr tool"
|
||||||
required: false
|
required: false
|
||||||
skip_packaging:
|
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
|
required: false
|
||||||
mark_as_latest:
|
mark_as_latest:
|
||||||
description: Mark the created GitHub release as 'latest'
|
description: Mark the created GitHub release as 'latest'
|
||||||
@@ -65,6 +68,10 @@ runs:
|
|||||||
args+=(--skip-packaging "${{ inputs.skip_packaging }}")
|
args+=(--skip-packaging "${{ inputs.skip_packaging }}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -n "${{ inputs.skip_existing }}" ]]; then
|
||||||
|
args+=(--skip-existing "${{ inputs.skip_existing }}")
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -n "${{ inputs.mark_as_latest }}" ]]; then
|
if [[ -n "${{ inputs.mark_as_latest }}" ]]; then
|
||||||
args+=(--mark-as-latest "${{ inputs.mark_as_latest }}")
|
args+=(--mark-as-latest "${{ inputs.mark_as_latest }}")
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ Usage: $(basename "$0") <options>
|
|||||||
-n, --install-dir The Path to install the cr tool
|
-n, --install-dir The Path to install the cr tool
|
||||||
-i, --install-only Just 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)
|
-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)
|
-l, --mark-as-latest Mark the created GitHub release as 'latest' (default: true)
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
@@ -46,6 +47,7 @@ main() {
|
|||||||
local install_dir=
|
local install_dir=
|
||||||
local install_only=
|
local install_only=
|
||||||
local skip_packaging=
|
local skip_packaging=
|
||||||
|
local skip_existing=
|
||||||
local mark_as_latest=true
|
local mark_as_latest=true
|
||||||
|
|
||||||
parse_command_line "$@"
|
parse_command_line "$@"
|
||||||
@@ -173,6 +175,12 @@ parse_command_line() {
|
|||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
--skip-existing)
|
||||||
|
if [[ -n "${2:-}" ]]; then
|
||||||
|
skip_existing="$2"
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
;;
|
||||||
-l|--mark-as-latest)
|
-l|--mark-as-latest)
|
||||||
if [[ -n "${2:-}" ]]; then
|
if [[ -n "${2:-}" ]]; then
|
||||||
mark_as_latest="$2"
|
mark_as_latest="$2"
|
||||||
@@ -280,6 +288,9 @@ release_charts() {
|
|||||||
if [[ -n "$config" ]]; then
|
if [[ -n "$config" ]]; then
|
||||||
args+=(--config "$config")
|
args+=(--config "$config")
|
||||||
fi
|
fi
|
||||||
|
if [[ -n "$skip_existing" ]]; then
|
||||||
|
args+=(--skip-existing)
|
||||||
|
fi
|
||||||
if [[ "$mark_as_latest" = false ]]; then
|
if [[ "$mark_as_latest" = false ]]; then
|
||||||
args+=(--make-release-latest=false)
|
args+=(--make-release-latest=false)
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user