mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-05-03 05:08:35 +02:00
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:
parent
631021bf98
commit
2bf6bc3646
5 changed files with 8 additions and 8 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue