diff --git a/.github/workflows/current-amd8-daily-build-devel.yml b/.github/workflows/current-amd8-daily-build-devel.yml index 08b772be..da640f2e 100644 --- a/.github/workflows/current-amd8-daily-build-devel.yml +++ b/.github/workflows/current-amd8-daily-build-devel.yml @@ -21,6 +21,12 @@ on: - main - v25_STABLE - REL24_10 + - custom + + custom_cli_branch: + description: "If 'custom' selected above, provide cli branch name" + required: false + type: string component: description: "Spock in-dev component to additionally build (e.g. spock60)" @@ -116,7 +122,20 @@ jobs: echo "Clean flag is disabled" fi - SELECTED_CLI_BRANCH="${{ inputs.cli_branch }}" + # If custom cli branch is chosen, set the branch provided in text field (cannot be empty) + # otherwise set it to selection from the drop down. + if [[ "${{ inputs.cli_branch }}" == "custom" ]]; then + if [[ -z "${{ inputs.custom_cli_branch }}" ]]; then + echo "Error: custom CLI branch selected but no branch name provided." + exit 1 + fi + SELECTED_CLI_BRANCH="${{ inputs.custom_cli_branch }}" + echo "Manual run: Using custom CLI branch: $SELECTED_CLI_BRANCH" + else + SELECTED_CLI_BRANCH="${{ inputs.cli_branch }}" + echo "Manual run: Using CLI branch: $SELECTED_CLI_BRANCH" + fi + COMPONENT="${{ inputs.component }}" BRANCH="${{ inputs.branch }}" echo "Manual run: Component=$COMPONENT, Branch=$BRANCH, CLI Branch=$SELECTED_CLI_BRANCH" @@ -175,7 +194,10 @@ jobs: git stash push -u -m "Temp stash for current build" || true echo "Switching to branch: $CLI_BRANCH" - git checkout "$CLI_BRANCH" || true + if ! git checkout "$CLI_BRANCH"; then + echo "Error: Invalid CLI branch name provided: $CLI_BRANCH" + exit 1 + fi echo "Branch checkout completed" # Execute the build script and collect artifacts into src/ and bin/ diff --git a/.github/workflows/current-arm9-daily-build-devel.yml b/.github/workflows/current-arm9-daily-build-devel.yml index b8c4d645..c06c80e0 100644 --- a/.github/workflows/current-arm9-daily-build-devel.yml +++ b/.github/workflows/current-arm9-daily-build-devel.yml @@ -21,6 +21,12 @@ on: - main - v25_STABLE - REL24_10 + - custom + + custom_cli_branch: + description: "If 'custom' selected above, provide cli branch name" + required: false + type: string component: description: "Spock in-dev component to additionally build (e.g. spock60)" @@ -116,7 +122,20 @@ jobs: echo "Clean flag is disabled" fi - SELECTED_CLI_BRANCH="${{ inputs.cli_branch }}" + # If custom cli branch is chosen, set the branch provided in text field (cannot be empty) + # otherwise set it to selection from the drop down. + if [[ "${{ inputs.cli_branch }}" == "custom" ]]; then + if [[ -z "${{ inputs.custom_cli_branch }}" ]]; then + echo "Error: custom CLI branch selected but no branch name provided." + exit 1 + fi + SELECTED_CLI_BRANCH="${{ inputs.custom_cli_branch }}" + echo "Manual run: Using custom CLI branch: $SELECTED_CLI_BRANCH" + else + SELECTED_CLI_BRANCH="${{ inputs.cli_branch }}" + echo "Manual run: Using CLI branch: $SELECTED_CLI_BRANCH" + fi + COMPONENT="${{ inputs.component }}" BRANCH="${{ inputs.branch }}" echo "Manual run: Component=$COMPONENT, Branch=$BRANCH, CLI Branch=$SELECTED_CLI_BRANCH" @@ -175,7 +194,10 @@ jobs: git stash push -u -m "Temp stash for current build" || true echo "Switching to branch: $CLI_BRANCH" - git checkout "$CLI_BRANCH" || true + if ! git checkout "$CLI_BRANCH"; then + echo "Error: Invalid CLI branch name provided: $CLI_BRANCH" + exit 1 + fi echo "Branch checkout completed" # Execute the build script and collect artifacts into src/ and bin/ diff --git a/.github/workflows/stable-amd8-daily-build-devel.yml b/.github/workflows/stable-amd8-daily-build-devel.yml index c8bb9887..233eadc0 100644 --- a/.github/workflows/stable-amd8-daily-build-devel.yml +++ b/.github/workflows/stable-amd8-daily-build-devel.yml @@ -15,6 +15,12 @@ on: - v25_STABLE - main - REL24_10 + - custom + + custom_cli_branch: + description: "If 'custom' selected above, provide cli branch name" + required: false + type: string prefix_selector: 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/" @@ -91,8 +97,17 @@ jobs: fi # Branch input - SELECTED_CLI_BRANCH="${{ inputs.cli_branch }}" - echo "Manual run: Selected CLI branch: $SELECTED_CLI_BRANCH" + if [[ "${{ inputs.cli_branch }}" == "custom" ]]; then + if [[ -z "${{ inputs.custom_cli_branch }}" ]]; then + echo "Error: 'custom' CLI branch selected but no branch name provided." + exit 1 + fi + SELECTED_CLI_BRANCH="${{ inputs.custom_cli_branch }}" + echo "Manual run: Using custom CLI branch: $SELECTED_CLI_BRANCH" + else + SELECTED_CLI_BRANCH="${{ inputs.cli_branch }}" + echo "Manual run: Using predefined CLI branch: $SELECTED_CLI_BRANCH" + fi fi # Set timestamped log file @@ -136,8 +151,12 @@ jobs: echo "Stashing changes (if any)..." git stash push -u -m "Temp stash for branch switch" || true - echo "Checking out branch: $CLI_BRANCH" - git checkout "$CLI_BRANCH" || true + echo "Switching to branch: $CLI_BRANCH" + if ! git checkout "$CLI_BRANCH"; then + echo "Error: Invalid CLI branch name provided: $CLI_BRANCH" + exit 1 + fi + echo "Branch checkout completed" - name: Run build and push to devel repo id: build_to_devel diff --git a/.github/workflows/stable-arm9-daily-build-devel.yml b/.github/workflows/stable-arm9-daily-build-devel.yml index c26fdfcb..ef11bba6 100644 --- a/.github/workflows/stable-arm9-daily-build-devel.yml +++ b/.github/workflows/stable-arm9-daily-build-devel.yml @@ -15,6 +15,12 @@ on: - v25_STABLE - main - REL24_10 + - custom + + custom_cli_branch: + description: "If 'custom' selected above, provide cli branch name" + required: false + type: string prefix_selector: 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/" @@ -91,8 +97,17 @@ jobs: fi # Branch input - SELECTED_CLI_BRANCH="${{ inputs.cli_branch }}" - echo "Manual run: Selected CLI branch: $SELECTED_CLI_BRANCH" + if [[ "${{ inputs.cli_branch }}" == "custom" ]]; then + if [[ -z "${{ inputs.custom_cli_branch }}" ]]; then + echo "Error: 'custom' CLI branch selected but no branch name provided." + exit 1 + fi + SELECTED_CLI_BRANCH="${{ inputs.custom_cli_branch }}" + echo "Manual run: Using custom CLI branch: $SELECTED_CLI_BRANCH" + else + SELECTED_CLI_BRANCH="${{ inputs.cli_branch }}" + echo "Manual run: Using predefined CLI branch: $SELECTED_CLI_BRANCH" + fi fi # Set timestamped log file @@ -136,8 +151,12 @@ jobs: echo "Stashing changes (if any)..." git stash push -u -m "Temp stash for branch switch" || true - echo "Checking out branch: $CLI_BRANCH" - git checkout "$CLI_BRANCH" || true + echo "Switching to branch: $CLI_BRANCH" + if ! git checkout "$CLI_BRANCH"; then + echo "Error: Invalid CLI branch name provided: $CLI_BRANCH" + exit 1 + fi + echo "Branch checkout completed" - name: Run build and push to devel repo id: build_to_devel