mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-12-26 00:32:08 -05: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
4
dist/main/index.js
vendored
4
dist/main/index.js
vendored
|
@ -64395,7 +64395,7 @@ const exec = __importStar(__nccwpck_require__(1514));
|
|||
const crypto = __importStar(__nccwpck_require__(6113));
|
||||
const path = __importStar(__nccwpck_require__(1017));
|
||||
const fs = __importStar(__nccwpck_require__(7147));
|
||||
const CACHE_PROTOCOL_VERSION = 'v7-';
|
||||
const CACHE_PROTOCOL_VERSION = 'v8-';
|
||||
const JOB_CONTEXT_PARAMETER = 'workflow-job-context';
|
||||
const CACHE_DISABLED_PARAMETER = 'cache-disabled';
|
||||
const CACHE_READONLY_PARAMETER = 'cache-read-only';
|
||||
|
@ -64461,7 +64461,7 @@ function getCacheKeyEnvironment() {
|
|||
return process.env[CACHE_KEY_OS_VAR] || runnerOs;
|
||||
}
|
||||
function getCacheKeyJob() {
|
||||
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() {
|
||||
const override = process.env[CACHE_KEY_JOB_INSTANCE_VAR];
|
||||
|
|
2
dist/main/index.js.map
vendored
2
dist/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/post/index.js
vendored
4
dist/post/index.js
vendored
|
@ -63498,7 +63498,7 @@ const exec = __importStar(__nccwpck_require__(1514));
|
|||
const crypto = __importStar(__nccwpck_require__(6113));
|
||||
const path = __importStar(__nccwpck_require__(1017));
|
||||
const fs = __importStar(__nccwpck_require__(7147));
|
||||
const CACHE_PROTOCOL_VERSION = 'v7-';
|
||||
const CACHE_PROTOCOL_VERSION = 'v8-';
|
||||
const JOB_CONTEXT_PARAMETER = 'workflow-job-context';
|
||||
const CACHE_DISABLED_PARAMETER = 'cache-disabled';
|
||||
const CACHE_READONLY_PARAMETER = 'cache-read-only';
|
||||
|
@ -63564,7 +63564,7 @@ function getCacheKeyEnvironment() {
|
|||
return process.env[CACHE_KEY_OS_VAR] || runnerOs;
|
||||
}
|
||||
function getCacheKeyJob() {
|
||||
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() {
|
||||
const override = process.env[CACHE_KEY_JOB_INSTANCE_VAR];
|
||||
|
|
2
dist/post/index.js.map
vendored
2
dist/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -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…
Reference in a new issue