Skip to content

Commit d2f5073

Browse files
moodyjoneukreign
authored andcommitted
Single "set pip cache dir" task with conditional inside.
1 parent 84e5e43 commit d2f5073

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,11 @@ jobs:
3535
- uses: actions/setup-python@v4
3636
with:
3737
python-version: '3.7'
38-
- name: set pip cache dir (linux/mac)
39-
if: (!startsWith(runner.os, 'windows'))
40-
id: pip-cache-nix
41-
run: echo "PIP_CACHE_DIR=$(pip cache dir)" >> $GITHUB_ENV
42-
- name: set pip cache dir (windows)
43-
if: startsWith(runner.os, 'windows')
44-
id: pip-cache-win
45-
run: echo "PIP_CACHE_DIR=$(pip cache dir)" >> $env:GITHUB_ENV
38+
- name: set pip cache dir
39+
- if: (!startsWith(runner.os, 'windows'))
40+
run: echo "PIP_CACHE_DIR=$(pip cache dir)" >> $GITHUB_ENV
41+
- if: startsWith(runner.os, 'windows')
42+
run: echo "PIP_CACHE_DIR=$(pip cache dir)" >> $env:GITHUB_ENV
4643
- name: debug pip cache
4744
run: echo "PIP_CACHE_DIR=${{ env.PIP_CACHE_DIR }}"
4845
- name: extract pip cache
@@ -158,14 +155,11 @@ jobs:
158155
uses: ASzc/change-string-case-action@v5
159156
with:
160157
string: ${{ runner.os }}
161-
- name: set pip cache dir (linux/mac)
162-
if: (!startsWith(runner.os, 'windows'))
163-
id: pip-cache-nix
164-
run: echo "PIP_CACHE_DIR=$(pip cache dir)" >> $GITHUB_ENV
165-
- name: set pip cache dir (windows)
166-
if: startsWith(runner.os, 'windows')
167-
id: pip-cache-win
168-
run: echo "PIP_CACHE_DIR=$(pip cache dir)" >> $env:GITHUB_ENV
158+
- name: set pip cache dir
159+
- if: (!startsWith(runner.os, 'windows'))
160+
run: echo "PIP_CACHE_DIR=$(pip cache dir)" >> $GITHUB_ENV
161+
- if: startsWith(runner.os, 'windows')
162+
run: echo "PIP_CACHE_DIR=$(pip cache dir)" >> $env:GITHUB_ENV
169163
- name: debug pip cache
170164
run: echo "PIP_CACHE_DIR=${{ env.PIP_CACHE_DIR }}"
171165
- name: extract pip cache

0 commit comments

Comments
 (0)