Skip to content

Commit a8736e5

Browse files
author
yuyi
committed
feat(index-path): added inputs for index-path and pages-index-path
Signed-off-by: yuyi <yuyi.wsy@oceanbase.com>
1 parent 13fe82a commit a8736e5

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ A GitHub action to turn a GitHub project into a self-hosted Helm chart repo, usi
2424
- `mark_as_latest`: When you set this to `false`, it will mark the created GitHub release not as 'latest'.
2525
- `packages_with_index`: When you set this to `true`, it will upload chart packages directly into publishing branch.
2626
- `pages_branch`: Name of the branch to be used to push the index and artifacts. (default to: gh-pages but it is not set in the action it is a default value for the chart-releaser binary)
27+
- `pages_index_path`: Path to the index file in the gh-pages branch. (default to: index.yaml but it is not set in the action)
28+
- `index_path`: Path to the index file. (default to: .cr-index/index.yaml but it is not set in the action)
2729

2830
### Outputs
2931

action.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ inputs:
5656
pages_branch:
5757
description: "Name of the branch to be used to push the index and artifacts. (default to: gh-pages but it is not set in the action it is a default value for the chart-releaser binary)"
5858
required: false
59+
pages_index_path:
60+
description: "The GitHub pages index path. (default to: index.yaml but it is not set in the action)"
61+
required: false
62+
index_path:
63+
description: "Path to index file. (default to: .cr-index/index.yaml but it is not set in the action)"
64+
required: false
5965
outputs:
6066
changed_charts:
6167
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."
@@ -120,6 +126,14 @@ runs:
120126
args+=(--pages-branch "${{ inputs.pages_branch }}")
121127
fi
122128
129+
if [[ -n "${{ inputs.pages_index_path }}" ]]; then
130+
args+=(--pages-index-path "${{ inputs.pages_index_path }}")
131+
fi
132+
133+
if [[ -n "${{ inputs.index_path }}" ]]; then
134+
args+=(--index-path "${{ inputs.index_path }}")
135+
fi
136+
123137
"$GITHUB_ACTION_PATH/cr.sh" "${args[@]}"
124138
125139
if [[ -f changed_charts.txt ]]; then

cr.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ main() {
5555
local mark_as_latest=true
5656
local packages_with_index=false
5757
local pages_branch=
58+
local index_path=
59+
local pages_index_path=
5860

5961
parse_command_line "$@"
6062

@@ -176,6 +178,18 @@ parse_command_line() {
176178
shift
177179
fi
178180
;;
181+
--index-path)
182+
if [[ -n "${2:-}" ]]; then
183+
index_path="$2"
184+
shift
185+
fi
186+
;;
187+
--pages-index-path)
188+
if [[ -n "${2:-}" ]]; then
189+
pages_index_path="$2"
190+
shift
191+
fi
192+
;;
179193
-n | --install-dir)
180194
if [[ -n "${2:-}" ]]; then
181195
install_dir="$2"
@@ -351,6 +365,12 @@ update_index() {
351365
if [[ -n "$pages_branch" ]]; then
352366
args+=(--pages-branch "$pages_branch")
353367
fi
368+
if [[ -n "$index_path" ]]; then
369+
args+=(--index-path "$index_path")
370+
fi
371+
if [[ -n "$pages_index_path" ]]; then
372+
args+=(--pages-index-path "$pages_index_path")
373+
fi
354374

355375
echo 'Updating charts repo index...'
356376
cr index "${args[@]}"

0 commit comments

Comments
 (0)