Skip to content

Commit a7f80e2

Browse files
committed
Adding custom CLI input in the remaining workflows
1 parent 0806a30 commit a7f80e2

File tree

3 files changed

+70
-10
lines changed

3 files changed

+70
-10
lines changed

.github/workflows/current-arm9-daily-build-devel.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ on:
2121
- main
2222
- v25_STABLE
2323
- REL24_10
24+
- custom
25+
26+
custom_cli_branch:
27+
description: "If 'custom' selected above, provide cli branch name"
28+
required: false
29+
type: string
2430

2531
component:
2632
description: "Spock in-dev component to additionally build (e.g. spock60)"
@@ -116,7 +122,20 @@ jobs:
116122
echo "Clean flag is disabled"
117123
fi
118124
119-
SELECTED_CLI_BRANCH="${{ inputs.cli_branch }}"
125+
# If custom cli branch is chosen, set the branch provided in text field (cannot be empty)
126+
# otherwise set it to selection from the drop down.
127+
if [[ "${{ inputs.cli_branch }}" == "custom" ]]; then
128+
if [[ -z "${{ inputs.custom_cli_branch }}" ]]; then
129+
echo "Error: custom CLI branch selected but no branch name provided."
130+
exit 1
131+
fi
132+
SELECTED_CLI_BRANCH="${{ inputs.custom_cli_branch }}"
133+
echo "Manual run: Using custom CLI branch: $SELECTED_CLI_BRANCH"
134+
else
135+
SELECTED_CLI_BRANCH="${{ inputs.cli_branch }}"
136+
echo "Manual run: Using CLI branch: $SELECTED_CLI_BRANCH"
137+
fi
138+
120139
COMPONENT="${{ inputs.component }}"
121140
BRANCH="${{ inputs.branch }}"
122141
echo "Manual run: Component=$COMPONENT, Branch=$BRANCH, CLI Branch=$SELECTED_CLI_BRANCH"
@@ -175,7 +194,10 @@ jobs:
175194
git stash push -u -m "Temp stash for current build" || true
176195
177196
echo "Switching to branch: $CLI_BRANCH"
178-
git checkout "$CLI_BRANCH" || true
197+
if ! git checkout "$CLI_BRANCH"; then
198+
echo "Error: Invalid CLI branch name provided: $CLI_BRANCH"
199+
exit 1
200+
fi
179201
echo "Branch checkout completed"
180202
181203
# Execute the build script and collect artifacts into src/ and bin/

.github/workflows/stable-amd8-daily-build-devel.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ on:
1515
- v25_STABLE
1616
- main
1717
- REL24_10
18+
- custom
19+
20+
custom_cli_branch:
21+
description: "If 'custom' selected above, provide cli branch name"
22+
required: false
23+
type: string
1824

1925
prefix_selector:
2026
description: "Choose target pgedge-devel repo sub-directory (default = MMDD, custom = your input). Packages will be at: https://pgedge-devel.s3.amazonaws.com/REPO/stable/<sub-dir>"
@@ -91,8 +97,17 @@ jobs:
9197
fi
9298
9399
# Branch input
94-
SELECTED_CLI_BRANCH="${{ inputs.cli_branch }}"
95-
echo "Manual run: Selected CLI branch: $SELECTED_CLI_BRANCH"
100+
if [[ "${{ inputs.cli_branch }}" == "custom" ]]; then
101+
if [[ -z "${{ inputs.custom_cli_branch }}" ]]; then
102+
echo "Error: 'custom' CLI branch selected but no branch name provided."
103+
exit 1
104+
fi
105+
SELECTED_CLI_BRANCH="${{ inputs.custom_cli_branch }}"
106+
echo "Manual run: Using custom CLI branch: $SELECTED_CLI_BRANCH"
107+
else
108+
SELECTED_CLI_BRANCH="${{ inputs.cli_branch }}"
109+
echo "Manual run: Using predefined CLI branch: $SELECTED_CLI_BRANCH"
110+
fi
96111
fi
97112
98113
# Set timestamped log file
@@ -136,8 +151,12 @@ jobs:
136151
echo "Stashing changes (if any)..."
137152
git stash push -u -m "Temp stash for branch switch" || true
138153
139-
echo "Checking out branch: $CLI_BRANCH"
140-
git checkout "$CLI_BRANCH" || true
154+
echo "Switching to branch: $CLI_BRANCH"
155+
if ! git checkout "$CLI_BRANCH"; then
156+
echo "Error: Invalid CLI branch name provided: $CLI_BRANCH"
157+
exit 1
158+
fi
159+
echo "Branch checkout completed"
141160
142161
- name: Run build and push to devel repo
143162
id: build_to_devel

.github/workflows/stable-arm9-daily-build-devel.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ on:
1515
- v25_STABLE
1616
- main
1717
- REL24_10
18+
- custom
19+
20+
custom_cli_branch:
21+
description: "If 'custom' selected above, provide cli branch name"
22+
required: false
23+
type: string
1824

1925
prefix_selector:
2026
description: "Choose target pgedge-devel repo sub-directory (default = MMDD, custom = your input). Packages will be at: https://pgedge-devel.s3.amazonaws.com/REPO/stable/<sub-dir>"
@@ -91,8 +97,17 @@ jobs:
9197
fi
9298
9399
# Branch input
94-
SELECTED_CLI_BRANCH="${{ inputs.cli_branch }}"
95-
echo "Manual run: Selected CLI branch: $SELECTED_CLI_BRANCH"
100+
if [[ "${{ inputs.cli_branch }}" == "custom" ]]; then
101+
if [[ -z "${{ inputs.custom_cli_branch }}" ]]; then
102+
echo "Error: 'custom' CLI branch selected but no branch name provided."
103+
exit 1
104+
fi
105+
SELECTED_CLI_BRANCH="${{ inputs.custom_cli_branch }}"
106+
echo "Manual run: Using custom CLI branch: $SELECTED_CLI_BRANCH"
107+
else
108+
SELECTED_CLI_BRANCH="${{ inputs.cli_branch }}"
109+
echo "Manual run: Using predefined CLI branch: $SELECTED_CLI_BRANCH"
110+
fi
96111
fi
97112
98113
# Set timestamped log file
@@ -136,8 +151,12 @@ jobs:
136151
echo "Stashing changes (if any)..."
137152
git stash push -u -m "Temp stash for branch switch" || true
138153
139-
echo "Checking out branch: $CLI_BRANCH"
140-
git checkout "$CLI_BRANCH" || true
154+
echo "Switching to branch: $CLI_BRANCH"
155+
if ! git checkout "$CLI_BRANCH"; then
156+
echo "Error: Invalid CLI branch name provided: $CLI_BRANCH"
157+
exit 1
158+
fi
159+
echo "Branch checkout completed"
141160
142161
- name: Run build and push to devel repo
143162
id: build_to_devel

0 commit comments

Comments
 (0)