Skip to content

Commit 6eb7df9

Browse files
committed
github actions cache: Use more unique key
1 parent 3f3b017 commit 6eb7df9

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

dist/index.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -1591,11 +1591,12 @@ exports.StateCacheStorage = void 0;
15911591
const fs_1 = __importDefault(__nccwpck_require__(7147));
15921592
const path_1 = __importDefault(__nccwpck_require__(1017));
15931593
const os_1 = __importDefault(__nccwpck_require__(2037));
1594+
const process_1 = __importDefault(__nccwpck_require__(7282));
15941595
const core = __importStar(__nccwpck_require__(2186));
15951596
const github_1 = __nccwpck_require__(5438);
15961597
const plugin_retry_1 = __nccwpck_require__(6298);
15971598
const cache = __importStar(__nccwpck_require__(7799));
1598-
const CACHE_KEY = '_state';
1599+
const CACHE_KEY = '_state' + process_1.default.env.GITHUB_WORKFLOW + '-' + process_1.default.env.GITHUB_JOB;
15991600
const STATE_FILE = 'state.txt';
16001601
const STALE_DIR = '56acbeaa-1fef-4c79-8f84-7565e560fb03';
16011602
const mkTempDir = () => {
@@ -89199,6 +89200,14 @@ module.exports = require("perf_hooks");
8919989200

8920089201
/***/ }),
8920189202

89203+
/***/ 7282:
89204+
/***/ ((module) => {
89205+
89206+
"use strict";
89207+
module.exports = require("process");
89208+
89209+
/***/ }),
89210+
8920289211
/***/ 5477:
8920389212
/***/ ((module) => {
8920489213

src/classes/state/state-cache-storage.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import {IStateStorage} from '../../interfaces/state/state-storage';
22
import fs from 'fs';
33
import path from 'path';
44
import os from 'os';
5+
import process from 'process';
56
import * as core from '@actions/core';
67
import {context, getOctokit} from '@actions/github';
78
import {retry as octokitRetry} from '@octokit/plugin-retry';
89
import * as cache from '@actions/cache';
910

10-
const CACHE_KEY = '_state';
11+
const CACHE_KEY =
12+
'_state' + process.env.GITHUB_WORKFLOW + '-' + process.env.GITHUB_JOB;
1113
const STATE_FILE = 'state.txt';
1214
const STALE_DIR = '56acbeaa-1fef-4c79-8f84-7565e560fb03';
1315

0 commit comments

Comments
 (0)