Skip to content

Commit f3f07d4

Browse files
committed
ci:优化 Windows 系统下的 shell 类型设置
-为 Windows 系统动态设置 SHELL_TYPE 环境变量 - 使用新设置的 SHELL_TYPE 或默认的 sh 执行后续步骤
1 parent 983e489 commit f3f07d4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/update-oss-licenses-dist.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ jobs:
3636
- name: Fetch latest changes from remote
3737
run: git fetch origin main
3838

39+
- name: Set shell type
40+
if: matrix.os == 'windows-latest'
41+
run: echo "SHELL_TYPE=bash" >> $GITHUB_ENV
42+
shell: bash
43+
3944
- name: Compare files
4045
id: compare-files
4146
run: |
@@ -44,7 +49,7 @@ jobs:
4449
else
4550
echo "files_changed=false" >> $GITHUB_ENV
4651
fi
47-
shell: ${{ matrix.os == 'windows-latest' && 'bash' || 'sh' }}
52+
shell: ${{ env.SHELL_TYPE || 'sh' }}
4853

4954
- name: Create Pull Request
5055
if: env.files_changed == 'true'

0 commit comments

Comments
 (0)