Skip to content

Commit

Permalink
add runner OS in cache key (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbguy authored Dec 9, 2024
1 parent c00f302 commit 9a2e0d3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dist/restore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77314,6 +77314,9 @@ class CacheConfig {
key += `-${job}`;
}
}
// Add runner OS to the key to avoid cross-contamination of cache
const runnerOS = external_os_default().type();
key += `-${runnerOS}`;
self.keyPrefix = key;
// Construct environment portion of the key:
// This consists of a hash that considers the rust version
Expand Down
3 changes: 3 additions & 0 deletions dist/save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77314,6 +77314,9 @@ class CacheConfig {
key += `-${job}`;
}
}
// Add runner OS to the key to avoid cross-contamination of cache
const runnerOS = external_os_default().type();
key += `-${runnerOS}`;
self.keyPrefix = key;
// Construct environment portion of the key:
// This consists of a hash that considers the rust version
Expand Down
4 changes: 4 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ export class CacheConfig {
}
}

// Add runner OS to the key to avoid cross-contamination of cache
const runnerOS = os.type();
key += `-${runnerOS}`;

self.keyPrefix = key;

// Construct environment portion of the key:
Expand Down

0 comments on commit 9a2e0d3

Please sign in to comment.