Skip to content

Commit ebfca77

Browse files
authored
ci: fix windows date variable for caching (#2444)
* fixes #2441 Turns out the environment variable used for the date wasn't getting set and exported correctly on windows because windows uses a very different environment variable setup. The key part of how to fix it was found here actions/runner-images#5251
1 parent 2fe8ffc commit ebfca77

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.github/workflows/testing.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,12 @@ jobs:
261261
- name: Get date
262262
id: get-date
263263
run: |
264-
echo "date=$(get-date -format "yyyyMMdd")" >> $GITHUB_OUTPUT
264+
echo "DATE=$(powershell get-date -format "yyyyMMdd")" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
265265
- name: Get cached database
266266
uses: actions/cache@v3
267267
with:
268268
path: ~/.cache/cve-bin-tool
269-
key: ${{ runner.os }}-cve-bin-tool-${{ steps.get-date.outputs.date }}
269+
key: ${{ runner.os }}-cve-bin-tool-${{ steps.get-date.outputs.DATE }}
270270
- name: Install cve-bin-tool
271271
run: |
272272
python -m pip install --upgrade pip
@@ -337,12 +337,12 @@ jobs:
337337
- name: Get date
338338
id: get-date
339339
run: |
340-
echo "date=$(get-date -format "yyyyMMdd")" >> $GITHUB_OUTPUT
340+
echo "DATE=$(powershell get-date -format "yyyyMMdd")" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
341341
- name: Get cached database
342342
uses: actions/cache@v3
343343
with:
344344
path: ~/.cache/cve-bin-tool
345-
key: ${{ runner.os }}-cve-bin-tool-${{ steps.get-date.outputs.date }}
345+
key: ${{ runner.os }}-cve-bin-tool-${{ steps.get-date.outputs.DATE }}
346346
- name: Install cve-bin-tool
347347
run: |
348348
python -m pip install --upgrade pip

.github/workflows/update-cache.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ jobs:
5757
- name: Get date
5858
id: get-date
5959
run: |
60-
echo "date=$(get-date -format "yyyyMMdd")" >> $GITHUB_OUTPUT
60+
echo "DATE=$(powershell get-date -format "yyyyMMdd")" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
6161
- uses: actions/cache@v3
6262
with:
6363
path: ~/.cache/cve-bin-tool
64-
key: ${{ runner.os }}-cve-bin-tool-${{ steps.get-date.outputs.date }}
64+
key: ${{ runner.os }}-cve-bin-tool-${{ steps.get-date.outputs.DATE }}
6565
- name: Install cve-bin-tool
6666
run: |
6767
python -m pip install --upgrade pip

0 commit comments

Comments
 (0)