Skip to content

Commit 3dec456

Browse files
committed
fix(workflows): refine cache key to hash specific file types
Updated `Build.yml` and `Build.cs` to include only specific file types (`*.cs`, `appsettings.json`, `packages.lock.json`) in the cache key hash. Improves cache accuracy and reduces unnecessary invalidation.
1 parent a4d3327 commit 3dec456

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.github/workflows/Build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
with:
8787
path: |
8888
${{ github.workspace }}/.atom
89-
key: ${{ format('{0}-atom-build-{1}', runner.os, hashFiles('_atom/**')) }}
89+
key: ${{ format('{0}-atom-build-{1}', runner.os, hashFiles('_atom/**/*.cs', '_atom/appsettings.json', '_atom/packages.lock.json')) }}
9090

9191
PackProjects:
9292
runs-on: ubuntu-latest

_atom/Build.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ internal partial class Build : BuildDefinition,
131131
WorkflowTargets.BuildAtom.WithOptions(new CleanAtomDirectory("_atom/bin"),
132132
new CleanAtomDirectory("_atom/obj"),
133133
WorkflowOptions.Cache.Save("atom-build",
134-
"${{ format('{0}-atom-build-{1}', runner.os, hashFiles('_atom/**')) }}",
134+
"${{ format('{0}-atom-build-{1}', runner.os, hashFiles('_atom/**/*.cs', '_atom/appsettings.json', '_atom/packages.lock.json')) }}",
135135
["${{ github.workspace }}/.atom"])),
136136
WorkflowTargets.PackProjects,
137137
WorkflowTargets.PackTool.WithGithubRunsOnMatrix(PlatformNames),

0 commit comments

Comments
 (0)