@@ -175,20 +175,33 @@ branding:
175175runs :
176176 using : " composite"
177177 steps :
178+ - name : Detect shell
179+ shell : sh
180+ run : |
181+ if [ -f /etc/os-release ]; then
182+ . /etc/os-release
183+ if [ "$ID" = "alpine" ]; then
184+ echo "CC_SHELL=ash" >> "$GITHUB_ENV"
185+ else
186+ echo "CC_SHELL=bash" >> "$GITHUB_ENV"
187+ fi
188+ else
189+ echo "CC_SHELL=bash" >> "$GITHUB_ENV"
190+ fi
178191 - name : Action version
179- shell : bash
192+ shell : ${{ env.CC_SHELL }}
180193 run : |
181194 CC_ACTION_VERSION=$(cat ${GITHUB_ACTION_PATH}/src/version)
182195 echo -e "\033[0;32m==>\033[0m Running Action version $CC_ACTION_VERSION"
183196 - name : Set safe directory
184197 if : ${{ inputs.disable_safe_directory != 'true' }}
185- shell : bash
198+ shell : ${{ env.CC_SHELL }}
186199 run : |
187200 git config --global --add safe.directory "${{ github.workspace }}"
188201 git config --global --add safe.directory "$GITHUB_WORKSPACE"
189202
190203 - name : Set fork
191- shell : bash
204+ shell : ${{ env.CC_SHELL }}
192205 run : |
193206 CC_FORK="false"
194207 if [ -n "$GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME" ] && [ "$GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME" != "$GITHUB_REPOSITORY" ];
@@ -216,7 +229,7 @@ runs:
216229 CC_USE_OIDC : ${{ inputs.use_oidc }}
217230
218231 - name : Get and set token
219- shell : bash
232+ shell : ${{ env.CC_SHELL }}
220233 run : |
221234 if [ "${{ inputs.use_oidc }}" == 'true' ] && [ "$CC_FORK" != 'true' ];
222235 then
@@ -238,7 +251,7 @@ runs:
238251 CC_OIDC_AUDIENCE : ${{ inputs.url || 'https://codecov.io' }}
239252
240253 - name : Override branch for forks
241- shell : bash
254+ shell : ${{ env.CC_SHELL }}
242255 run : |
243256 if [ -z "$CC_BRANCH" ] && [ -z "$CC_TOKEN" ] && [ "$CC_FORK" == 'true' ]
244257 then
@@ -256,7 +269,7 @@ runs:
256269 GITHUB_REPOSITORY : ${{ github.repository }}
257270
258271 - name : Override commits and pr for pull requests
259- shell : bash
272+ shell : ${{ env.CC_SHELL }}
260273 run : |
261274 if [ -z "$CC_SHA" ];
262275 then
@@ -278,7 +291,7 @@ runs:
278291
279292 - name : Upload coverage to Codecov
280293 run : ${GITHUB_ACTION_PATH}/dist/codecov.sh
281- shell : bash
294+ shell : ${{ env.CC_SHELL }}
282295 working-directory : ${{ inputs.working-directory }}
283296 env :
284297 CC_BASE_SHA : ${{ inputs.base_sha }}
0 commit comments