Skip to content

Commit 40df43e

Browse files
committed
add flag to skip updating helm chart repo index
1 parent be16258 commit 40df43e

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ A GitHub action to turn a GitHub project into a self-hosted Helm chart repo, usi
2020
- `charts_dir`: The charts directory
2121
- `charts_repo_url`: The GitHub Pages URL to the charts repo (default: `https://<owner>.github.io/<project>`)
2222
- `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.
23+
- `skip_update_index`: This option, when populated, will skip updating helm chart repo index.
2324

2425
### Environment variables
2526

action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ inputs:
2525
skip_packaging:
2626
description: "skip the packaging option (do your custom packaging before running this action"
2727
required: false
28+
skip_update_index:
29+
description: "skip updating helm chart repo index"
30+
required: false
2831

2932
runs:
3033
using: composite
@@ -60,6 +63,10 @@ runs:
6063
if [[ -n "${{ inputs.skip_packaging }}" ]]; then
6164
args+=(--skip-packaging "${{ inputs.skip_packaging }}")
6265
fi
66+
67+
if [[ -n "${{ inputs.skip_update_index }}" ]]; then
68+
args+=(--skip-update-index "${{ inputs.skip_update_index }}")
69+
fi
6370
6471
"$GITHUB_ACTION_PATH/cr.sh" "${args[@]}"
6572
shell: bash

cr.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Usage: $(basename "$0") <options>
3333
-n, --install-dir The Path to install the cr tool
3434
-i, --install-only Just install the cr tool
3535
-s, --skip-packaging Skip the packaging step (run your own packaging before using the releaser)
36+
-u, --skip-update-index Skip update index step
3637
EOF
3738
}
3839

@@ -45,6 +46,7 @@ main() {
4546
local install_dir=
4647
local install_only=
4748
local skip_packaging=
49+
local skip_update_index=
4850

4951
parse_command_line "$@"
5052

@@ -81,7 +83,9 @@ main() {
8183
done
8284

8385
release_charts
84-
update_index
86+
if [ -z "$skip_update_index" ]; then
87+
update_index
88+
fi
8589
else
8690
echo "Nothing to do. No chart changes detected."
8791
fi
@@ -90,7 +94,9 @@ main() {
9094
rm -rf .cr-index
9195
mkdir -p .cr-index
9296
release_charts
93-
update_index
97+
if [ -z "$skip_update_index" ]; then
98+
update_index
99+
fi
94100
fi
95101

96102
popd > /dev/null
@@ -171,6 +177,12 @@ parse_command_line() {
171177
shift
172178
fi
173179
;;
180+
-u|--skip-update-index)
181+
if [[ -n "${2:-}" ]]; then
182+
skip_update_index="$2"
183+
shift
184+
fi
185+
;;
174186
*)
175187
break
176188
;;

0 commit comments

Comments
 (0)