Skip to content

Commit 00e2263

Browse files
committed
Simplify hashFiles() usage
1 parent 29d1aeb commit 00e2263

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Diff for: .github/workflows/integration-jobs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- uses: actions/cache@v3
4848
with:
4949
path: ${{ github.workspace }}/.nuget/packages
50-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.[cf]sproj*') }}-${{ hashFiles('**/*.Build.props') }}
50+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.[cf]sproj*', '**/*.Build.props') }}
5151
restore-keys: |
5252
${{ runner.os }}-nuget-
5353
- uses: actions/cache@v3

Diff for: .github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ env:
3131
# Configuration
3232
BUILD_CONFIG: 'Release'
3333
GLOBAL_JSON_FILE: 'global.json'
34-
LOCKFILE_PATTERN: '**/packages.lock.json'
34+
CACHE_PATTERNS: '["**/*.[cf]sproj*", "**/*.Build.props"]'
3535
PACKAGE_PATH: 'nupkg'
3636
# .NET SDK related environment variables
3737
DOTNET_NOLOGO: 1
@@ -63,7 +63,7 @@ jobs:
6363
uses: 'actions/cache@v4'
6464
with:
6565
path: '~/.nuget/packages'
66-
key: '${{ runner.os }}-nuget-${{ inputs.flavor }}-${{ hashFiles(env.LOCKFILE_PATTERN) }}'
66+
key: '${{ runner.os }}-nuget-${{ inputs.flavor }}-${{ hashFiles(fromJson(env.CACHE_PATTERNS)) }}'
6767
restore-keys: '${{ runner.os }}-nuget-${{ inputs.flavor }}-'
6868

6969
- name: '.NET Restore'

Diff for: .github/workflows/stale-jobs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- uses: actions/cache@v3
3232
with:
3333
path: ${{ github.workspace }}/.nuget/packages
34-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.[cf]sproj*') }}-${{ hashFiles('**/*.Build.props') }}
34+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.[cf]sproj*', '**/*.Build.props') }}
3535
restore-keys: |
3636
${{ runner.os }}-nuget-
3737

Diff for: .github/workflows/test-jobs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- uses: actions/cache@v3
3131
with:
3232
path: ${{ github.workspace }}/.nuget/packages
33-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.[cf]sproj*') }}-${{ hashFiles('**/*.Build.props') }}
33+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.[cf]sproj*', '**/*.Build.props') }}
3434
restore-keys: |
3535
${{ runner.os }}-nuget-
3636
@@ -60,7 +60,7 @@ jobs:
6060
- uses: actions/cache@v3
6161
with:
6262
path: ${{ github.workspace }}/.nuget/packages
63-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.[cf]sproj*') }}-${{ hashFiles('**/*.Build.props') }}
63+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.[cf]sproj*', '**/*.Build.props') }}
6464
restore-keys: |
6565
${{ runner.os }}-nuget-
6666

0 commit comments

Comments
 (0)