Include workflow name in cache key

Fixes #699 by avoiding cache key collisions between jobs with the
same name in different workflows.
This commit is contained in:
daz 2023-05-23 14:38:34 -06:00
parent 631021bf98
commit 2bf6bc3646
No known key found for this signature in database
5 changed files with 8 additions and 8 deletions

View file

@ -9,7 +9,7 @@ import * as fs from 'fs'
import {CacheEntryListener} from './cache-reporting'
const CACHE_PROTOCOL_VERSION = 'v7-'
const CACHE_PROTOCOL_VERSION = 'v8-'
const JOB_CONTEXT_PARAMETER = 'workflow-job-context'
const CACHE_DISABLED_PARAMETER = 'cache-disabled'
@ -115,7 +115,7 @@ function getCacheKeyEnvironment(): string {
}
function getCacheKeyJob(): string {
return process.env[CACHE_KEY_JOB_VAR] || github.context.job
return process.env[CACHE_KEY_JOB_VAR] || `${github.context.workflow}-${github.context.job}`
}
function getCacheKeyJobInstance(): string {