Skip to content

Commit b0271a5

Browse files
authored
Refactor duplicated code in CI (#2295)
1 parent 715a93f commit b0271a5

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

.github/util/initialize/action.yml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,10 @@ runs:
2626
# The composite action requires an explict shell, but bash is not available on windows-arm64 runner.
2727
# For the following commands conditionally use bash or powershell based on the runner.os:
2828
- run: dart pub get
29-
if: runner.os != 'Windows'
30-
shell: bash
31-
32-
- run: dart pub get
33-
if: runner.os == 'Windows'
34-
shell: powershell
29+
shell: ${{ runner.os == 'Windows' && 'powershell' || 'bash' }}
3530

3631
- run: npm install
37-
if: runner.os != 'Windows'
38-
shell: bash
39-
40-
- run: npm install
41-
if: runner.os == 'Windows'
42-
shell: powershell
32+
shell: ${{ runner.os == 'Windows' && 'powershell' || 'bash' }}
4333

4434
- uses: bufbuild/[email protected]
4535
with: {github_token: "${{ inputs.github-token }}"}
@@ -59,13 +49,6 @@ runs:
5949
with: {repository: sass/sass, path: build/language}
6050

6151
- name: Generate Dart from protobuf
62-
if: runner.os != 'Windows'
6352
run: dart run grinder protobuf
6453
env: {UPDATE_SASS_SASS_REPO: false}
65-
shell: bash
66-
67-
- name: Generate Dart from protobuf
68-
if: runner.os == 'Windows'
69-
run: dart run grinder protobuf
70-
env: {UPDATE_SASS_SASS_REPO: false}
71-
shell: powershell
54+
shell: ${{ runner.os == 'Windows' && 'powershell' || 'bash' }}

0 commit comments

Comments
 (0)