Allow entries with same Job ID to match in different workflows

Previously, the workflow name was always included when matching a cache entry for the current job.
This can be overly restrictive when job definitions are shared between different workflows. 
The workflow name is still encoded in the cache entry key, but not in the restore key searching for entries with a matching job.

Fixes #1017
This commit is contained in:
Daz DeBoer 2024-01-04 02:38:36 +01:00 committed by GitHub
parent 270f30ba56
commit 32bab5b15a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 80 deletions

View file

@ -17,10 +17,4 @@ describe('cacheUtils-utils', () => {
expect(posixHash).toBe(windowsHash)
})
})
describe('sanitizes workflow name in cache key', () => {
it('with comma', () => {
const cacheKey = cacheUtils.getCacheKeyForJob("Workflow, with,commas", "JOB_ID")
expect(cacheKey).toBe('workflow withcommas-JOB_ID')
})
})
})