From 630aec9d066579f9ae6f58561691bdf1be17904b Mon Sep 17 00:00:00 2001 From: acuD1 Date: Mon, 15 May 2023 12:22:56 +0200 Subject: [PATCH] feat: add option --skip-upload, to not handle index.yaml for OCI charts Signed-off-by: acuD1 --- action.yml | 7 +++++++ cr.sh | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/action.yml b/action.yml index ade9f00..db96efe 100644 --- a/action.yml +++ b/action.yml @@ -28,6 +28,9 @@ inputs: skip_existing: description: "Skip package upload if release exists" required: false + skip_upload: + description: "Skip package upload" + required: false mark_as_latest: description: Mark the created GitHub release as 'latest' required: false @@ -86,6 +89,10 @@ runs: args+=(--skip-existing "${{ inputs.skip_existing }}") fi + if [[ -n "${{ inputs.skip_upload }}" ]]; then + args+=(--skip-upload "${{ inputs.skip_upload }}") + fi + if [[ -n "${{ inputs.mark_as_latest }}" ]]; then args+=(--mark-as-latest "${{ inputs.mark_as_latest }}") fi diff --git a/cr.sh b/cr.sh index 3a6f990..e1977b1 100755 --- a/cr.sh +++ b/cr.sh @@ -35,6 +35,7 @@ Usage: $(basename "$0") -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 + --skip-upload Skip package upload, just create the release. Not needed in case of OCI upload. -l, --mark-as-latest Mark the created GitHub release as 'latest' (default: true) --packages-with-index Upload chart packages directly into publishing branch EOF @@ -50,6 +51,7 @@ main() { local install_only= local skip_packaging= local skip_existing= + local skip_upload= local mark_as_latest=true local packages_with_index=false local pages_branch= @@ -198,6 +200,12 @@ parse_command_line() { shift fi ;; + --skip-upload) + if [[ -n "${2:-}" ]]; then + skip_upload="$2" + shift + fi + ;; -l | --mark-as-latest) if [[ -n "${2:-}" ]]; then mark_as_latest="$2" @@ -328,6 +336,11 @@ release_charts() { } update_index() { + if [[ -n "$skip_upload" ]]; then + echo "Skipping index upload..." + return + fi + local args=(-o "$owner" -r "$repo" --push) if [[ -n "$config" ]]; then args+=(--config "$config")