diff --git a/README.md b/README.md index ec66ffd..6cca28a 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. +- `skip_update_index`: This option, when populated, will skip updating helm chart repo index. ### Environment variables diff --git a/action.yml b/action.yml index c89cf54..1a73072 100644 --- a/action.yml +++ b/action.yml @@ -25,6 +25,9 @@ inputs: skip_packaging: description: "skip the packaging option (do your custom packaging before running this action" required: false + skip_update_index: + description: "skip updating helm chart repo index" + required: false runs: using: composite @@ -60,6 +63,10 @@ runs: if [[ -n "${{ inputs.skip_packaging }}" ]]; then args+=(--skip-packaging "${{ inputs.skip_packaging }}") fi + + if [[ -n "${{ inputs.skip_update_index }}" ]]; then + args+=(--skip-update-index "${{ inputs.skip_update_index }}") + fi "$GITHUB_ACTION_PATH/cr.sh" "${args[@]}" shell: bash diff --git a/cr.sh b/cr.sh index f4f3877..53cf026 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) + -u, --skip-update-index Skip update index step EOF } @@ -45,6 +46,7 @@ main() { local install_dir= local install_only= local skip_packaging= + local skip_update_index= parse_command_line "$@" @@ -81,7 +83,9 @@ main() { done release_charts - update_index + if [ -z "$skip_update_index" ]; then + update_index + fi else echo "Nothing to do. No chart changes detected." fi @@ -90,7 +94,9 @@ main() { rm -rf .cr-index mkdir -p .cr-index release_charts - update_index + if [ -z "$skip_update_index" ]; then + update_index + fi fi popd > /dev/null @@ -171,6 +177,12 @@ parse_command_line() { shift fi ;; + -u|--skip-update-index) + if [[ -n "${2:-}" ]]; then + skip_update_index="$2" + shift + fi + ;; *) break ;;