Unverified Commit 2bf6bc36 authored by daz's avatar daz
Browse files

Include workflow name in cache key

Fixes #699 by avoiding cache key collisions between jobs with the
same name in different workflows.
parent 631021bf
Loading
Loading
Loading
Loading
+2 −2
Changes for dist/main/index.js: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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];
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Changes for dist/post/index.js: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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];
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Changes for src/cache-utils.ts: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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 {