diff --git a/README.md b/README.md index ec66ffd..e689410 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ A GitHub action to turn a GitHub project into a self-hosted Helm chart repo, usi - `charts_dir`: The charts directory - `charts_repo_url`: The GitHub Pages URL to the charts repo (default: `https://.github.io/`) - `skip_packaging`: This option, when populated, will skip the packaging step. This allows you to do more advanced packaging of your charts (for example, with the `helm package` command) before this action runs. This action will only handle the indexing and publishing steps. +- `mark_as_latest`: When you set this to `false`, it will mark the created GitHub release not as 'latest'. ### Environment variables diff --git a/action.yml b/action.yml index c89cf54..3521e64 100644 --- a/action.yml +++ b/action.yml @@ -25,6 +25,10 @@ inputs: skip_packaging: description: "skip the packaging option (do your custom packaging before running this action" required: false + mark_as_latest: + description: Mark the created GitHub release as 'latest' + required: false + default: true runs: using: composite @@ -61,5 +65,9 @@ runs: args+=(--skip-packaging "${{ inputs.skip_packaging }}") fi + if [[ -n "${{ inputs.mark_as_latest }}" ]]; then + args+=(--mark-as-latest "${{ inputs.mark_as_latest }}") + fi + "$GITHUB_ACTION_PATH/cr.sh" "${args[@]}" shell: bash diff --git a/cr.sh b/cr.sh index f4f3877..ff38417 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) + -l, --mark-as-latest Mark the created GitHub release as 'latest' (default: true) EOF } @@ -45,6 +46,7 @@ main() { local install_dir= local install_only= local skip_packaging= + local mark_as_latest=true parse_command_line "$@" @@ -171,6 +173,12 @@ parse_command_line() { shift fi ;; + -l|--mark-as-latest) + if [[ -n "${2:-}" ]]; then + mark_as_latest="$2" + shift + fi + ;; *) break ;; @@ -272,6 +280,9 @@ release_charts() { if [[ -n "$config" ]]; then args+=(--config "$config") fi + if [[ "$mark_as_latest" = false ]]; then + args+=(--make-release-latest=false) + fi echo 'Releasing charts...' cr upload "${args[@]}"