Added: --packages-with-index parameter (#148)
* Added: --packages-with-index parameter Signed-off-by: Valeriano Manassero <14011549+valeriano-manassero@users.noreply.github.com> --------- Signed-off-by: Valeriano Manassero <14011549+valeriano-manassero@users.noreply.github.com>
This commit is contained in:
@@ -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_dir`: The charts directory
|
||||||
- `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_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'.
|
- `mark_as_latest`: When you set this to `false`, it will mark the created GitHub release not as 'latest'.
|
||||||
|
- `packages_with_index`: When you set this to `true`, it will upload chart packages directly into publishing branch.
|
||||||
|
|
||||||
### Outputs
|
### Outputs
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ inputs:
|
|||||||
description: Mark the created GitHub release as 'latest'
|
description: Mark the created GitHub release as 'latest'
|
||||||
required: false
|
required: false
|
||||||
default: true
|
default: true
|
||||||
|
packages_with_index:
|
||||||
|
description: "Upload chart packages directly into publishing branch"
|
||||||
|
required: false
|
||||||
outputs:
|
outputs:
|
||||||
changed_charts:
|
changed_charts:
|
||||||
description: "A comma-separated list of charts that were released on this run. Will be an empty string if no updates were detected, will be unset if `--skip_packaging` is used: in the latter case your custom packaging step is responsible for setting its own outputs if you need them."
|
description: "A comma-separated list of charts that were released on this run. Will be an empty string if no updates were detected, will be unset if `--skip_packaging` is used: in the latter case your custom packaging step is responsible for setting its own outputs if you need them."
|
||||||
@@ -84,6 +87,10 @@ runs:
|
|||||||
args+=(--mark-as-latest "${{ inputs.mark_as_latest }}")
|
args+=(--mark-as-latest "${{ inputs.mark_as_latest }}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -n "${{ inputs.packages_with_index }}" ]]; then
|
||||||
|
args+=(--packages-with-index "${{ inputs.packages_with_index }}")
|
||||||
|
fi
|
||||||
|
|
||||||
"$GITHUB_ACTION_PATH/cr.sh" "${args[@]}"
|
"$GITHUB_ACTION_PATH/cr.sh" "${args[@]}"
|
||||||
|
|
||||||
if [[ -f changed_charts.txt ]]; then
|
if [[ -f changed_charts.txt ]]; then
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ main() {
|
|||||||
local skip_packaging=
|
local skip_packaging=
|
||||||
local skip_existing=
|
local skip_existing=
|
||||||
local mark_as_latest=true
|
local mark_as_latest=true
|
||||||
|
local packages_with_index=false
|
||||||
|
|
||||||
parse_command_line "$@"
|
parse_command_line "$@"
|
||||||
|
|
||||||
@@ -194,6 +195,12 @@ parse_command_line() {
|
|||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
--packages-with-index)
|
||||||
|
if [[ -n "${2:-}" ]]; then
|
||||||
|
packages_with_index="$2"
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
@@ -295,7 +302,9 @@ release_charts() {
|
|||||||
if [[ -n "$config" ]]; then
|
if [[ -n "$config" ]]; then
|
||||||
args+=(--config "$config")
|
args+=(--config "$config")
|
||||||
fi
|
fi
|
||||||
if [[ -n "$skip_existing" ]]; then
|
if [[ -n "$packages_with_index" ]]; then
|
||||||
|
args+=(--packages-with-index --push --skip-existing)
|
||||||
|
elif [[ -n "$skip_existing" ]]; then
|
||||||
args+=(--skip-existing)
|
args+=(--skip-existing)
|
||||||
fi
|
fi
|
||||||
if [[ "$mark_as_latest" = false ]]; then
|
if [[ "$mark_as_latest" = false ]]; then
|
||||||
@@ -311,6 +320,9 @@ update_index() {
|
|||||||
if [[ -n "$config" ]]; then
|
if [[ -n "$config" ]]; then
|
||||||
args+=(--config "$config")
|
args+=(--config "$config")
|
||||||
fi
|
fi
|
||||||
|
if [[ -n "$packages_with_index" ]]; then
|
||||||
|
args+=(--packages-with-index --index-path .)
|
||||||
|
fi
|
||||||
|
|
||||||
echo 'Updating charts repo index...'
|
echo 'Updating charts repo index...'
|
||||||
cr index "${args[@]}"
|
cr index "${args[@]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user