Skip to content

Commit 268d0c1

Browse files
committed
feat: Allowed to the user to add many charts to release separed with space ex: chart1 chart2 chart3
1 parent 4316af8 commit 268d0c1

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

.github/workflows/manage_release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99
- 'charts/**'
1010
workflow_dispatch:
1111
inputs:
12-
chart:
13-
description: "Chart to release (leave empty for automatic detection)"
12+
charts:
13+
description: "Chart(s) to release, space-separated (eg: geokoder trakkar). Leave empty for automatic detection."
1414
required: false
1515
default: ""
1616
dev:
@@ -50,7 +50,7 @@ jobs:
5050
GITHUB_EVENT_NAME: ${{ github.event_name }}
5151
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
5252
GITHUB_EVENT_AFTER: ${{ github.event.after }}
53-
INPUT_CHART: ${{ github.event.inputs.chart }}
53+
INPUT_CHART: ${{ github.event.inputs.charts }}
5454
run: bash ./scripts/detect_charts.sh
5555

5656
# Release the detected charts

scripts/detect_charts.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,21 @@ _add_chart() {
7575

7676
begin_group "Detect charts" >&2
7777

78-
# 1: chart provided manually
78+
# 1: chart(s) provided manually with space-separated list supported
7979
if [[ -n "${INPUT_CHART}" ]]; then
80-
echo "-> Chart provided manually: ${INPUT_CHART}" >&2
81-
_add_chart "${INPUT_CHART}"
80+
echo "-> Chart(s) provided manually: ${INPUT_CHART}" >&2
81+
for CHART in ${INPUT_CHART}; do
82+
_add_chart "$CHART"
83+
done
8284

83-
# 2: no diff range -> include all charts
85+
# 2: no diff range -> include all charts
8486
elif [[ -z "${DIFF_RANGE}" ]]; then
8587
echo "-> No diff range: including all non-library charts" >&2
8688
for CHART_DIR in "${REPO_ROOT}"/charts/*/; do
8789
_add_chart "$(basename "${CHART_DIR}")"
8890
done
8991

90-
# 3: normal push -> detect from git diff
92+
# 3: normal push -> detect from git diff
9193
else
9294
CHANGED_FILES=$(git diff --name-only "${DIFF_RANGE}" \
9395
-- 'charts/' 2>/dev/null || true)

0 commit comments

Comments
 (0)