Skip to content

Commit da70713

Browse files
spboltonclaude
andcommitted
fix(ci): install Homebrew bash for SDKMAN on macOS runners #35004 (#35039)
## Summary - Installs Homebrew bash (4+) on macOS runners before running SDKMAN installer - macOS runners ship Bash 3.2 but SDKMAN 5.21+ requires Bash 4+ - The previous zsh workaround failed — SDKMAN's installer uses bashisms throughout ([confirmed by SDKMAN team](sdkman/sdkman-cli#1520)) - Only runs on SDKMAN cache miss (~10-15s overhead, rare after first run) - Stopgap until mise replaces SDKMAN in the pipeline ## Test plan - [ ] Verify macOS CI jobs install SDKMAN successfully - [ ] Verify Linux CI jobs are unaffected (continue using system bash 5.x) - [ ] Verify cached runs skip both the brew install and SDKMAN install steps 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1a6fd03 commit da70713

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

.github/actions/core-cicd/setup-java/action.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,29 @@ runs:
6161
with:
6262
path: ~/.sdkman
6363
key: ${{ runner.os }}-${{ env.ARCHITECTURE }}-sdkman-install
64+
- name: Install Bash 4+ (macOS)
65+
if: ${{ steps.restore-cache-sdkman.outputs.cache-hit != 'true' && runner.os == 'macOS' }}
66+
shell: bash
67+
run: |
68+
# macOS ships Bash 3.2 but SDKMAN 5.21+ requires Bash 4+.
69+
# Homebrew is pre-installed on GitHub macOS runners.
70+
brew install bash
71+
echo "Installed Bash: $($(brew --prefix)/bin/bash --version | head -1)"
6472
- name: Install SDKMan
6573
id: install-sdkman
6674
if: ${{ steps.restore-cache-sdkman.outputs.cache-hit != 'true' }}
6775
shell: bash
6876
run: |
6977
if [ ! -f "$HOME/.sdkman/bin/sdkman-init.sh" ]; then
70-
echo "Downloading SDKMAN install"
71-
if [[ "$RUNNER_OS" == "macOS" ]]; then
72-
curl -s "https://get.sdkman.io" | zsh
73-
else
74-
curl -s "https://get.sdkman.io" | bash
75-
fi
78+
echo "Downloading SDKMAN install"
79+
# Use Homebrew bash on macOS (Bash 4+), system bash on Linux (already 5.x)
80+
if [[ "$RUNNER_OS" == "macOS" ]]; then
81+
BREW_BASH="$(brew --prefix)/bin/bash"
82+
echo "Using Homebrew bash: $($BREW_BASH --version | head -1)"
83+
curl -s "https://get.sdkman.io" | "$BREW_BASH"
84+
else
85+
curl -s "https://get.sdkman.io" | bash
86+
fi
7687
fi
7788
- name: Save Cache SDKMan install
7889
id: save-cache-sdkman

0 commit comments

Comments
 (0)