Skip to content

Commit c6532b2

Browse files
authored
fix(ci): add explicit bash shell for cross-platform compatibility in cache-refresh workflow (#9934)
The cache-refresh workflow runs on Linux, macOS, and Windows runners. Commands using bash-specific syntax (like ${{ }} expansions and | multi-line blocks) need explicit shell: bash directive to work correctly on Windows where PowerShell is the default shell. This ensures all bash commands execute properly across all operating systems.
1 parent d8c1414 commit c6532b2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.github/workflows/cache-refresh.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ jobs:
8888
# For logging and debugging purposes
8989
- name: Get yarn cache directory path
9090
id: yarn-cache-dir-path
91+
shell: bash
9192
run: echo "dir=${{ github.workspace }}/.yarn" >> "$GITHUB_OUTPUT"
9293

9394
# Step 4: Install dependencies to refresh cache
@@ -96,6 +97,7 @@ jobs:
9697
# - Update cache files in .yarn/cache directory
9798
# - GitHub Actions will auto-save updated cache at job end
9899
- name: Install dependencies (refresh cache)
100+
shell: bash
99101
env:
100102
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101103
NODE_OPTIONS: '--max_old_space_size=4096'
@@ -107,6 +109,7 @@ jobs:
107109
108110
# Step 5: Display cache statistics
109111
- name: Display cache statistics
112+
shell: bash
110113
run: |
111114
echo "=== Yarn Cache Statistics ==="
112115
echo "Cache directory: ${{ steps.yarn-cache-dir-path.outputs.dir }}"
@@ -120,6 +123,7 @@ jobs:
120123
121124
# Step 6: Verify dependency integrity
122125
- name: Verify dependency integrity
126+
shell: bash
123127
run: |
124128
echo "Verifying installed dependencies..."
125129
yarn install --immutable --immutable-cache --check-cache

0 commit comments

Comments
 (0)