Skip to content

Commit cd04698

Browse files
committed
package, upgrade dependencies, rev 2.0.1
1 parent 4c4a048 commit cd04698

File tree

4 files changed

+77
-65
lines changed

4 files changed

+77
-65
lines changed

dist/index.js

+23-11
Original file line numberDiff line numberDiff line change
@@ -61843,6 +61843,14 @@ module.exports = require("path");
6184361843

6184461844
/***/ }),
6184561845

61846+
/***/ 7282:
61847+
/***/ ((module) => {
61848+
61849+
"use strict";
61850+
module.exports = require("process");
61851+
61852+
/***/ }),
61853+
6184661854
/***/ 5477:
6184761855
/***/ ((module) => {
6184861856

@@ -61968,6 +61976,7 @@ const core = __nccwpck_require__(2186)
6196861976
const github = __nccwpck_require__(5438)
6196961977
const cache = __nccwpck_require__(7799)
6197061978
const fs = __nccwpck_require__(7147)
61979+
const process = __nccwpck_require__(7282)
6197161980

6197261981
const RESULT_PATH = '/tmp/prev-result'
6197361982

@@ -61981,14 +61990,13 @@ const run = async () => {
6198161990
const cacheGroup = core.getInput('cache-group')
6198261991
const keyPrefix = `cache-result-action-${cacheGroup}-${sha}`
6198361992
const key = keyPrefix + '-' + Math.floor(Date.now() / 1000)
61984-
61993+
6198561994
await cache.restoreCache([RESULT_PATH], key, [keyPrefix])
6198661995

6198761996
let actualResult = inputResult
6198861997

6198961998
// True if we have a previous result already.
6199061999
const cacheHit = !!fs.existsSync(RESULT_PATH)
61991-
6199262000
let cacheOutcome = cacheHit ? 'hit' : 'miss'
6199362001

6199462002
// If the result is 'unknown' then we won't save it to the cache; we're in "restore only" mode.
@@ -62000,18 +62008,22 @@ const run = async () => {
6200062008
actualResult = fs.readFileSync(RESULT_PATH, { encoding: 'utf8' })
6200162009
}
6200262010

62011+
const resultSummary = [
62012+
[{data: 'Output', header: true}, {data: 'Result', header: true}],
62013+
['result', actualResult],
62014+
['cache_key', key],
62015+
['cache_outcome', cacheOutcome],
62016+
]
62017+
6200362018
core.setOutput('result', actualResult)
62004-
62005-
await core.summary
62006-
.addTable([
62007-
[{data: 'Output', header: true}, {data: 'Result', header: true}],
62008-
['result', actualResult],
62009-
['cache_key', key],
62010-
['cache_outcome', cacheOutcome],
62011-
])
62012-
.write()
62019+
await core.summary.addTable(resultSummary).write()
62020+
62021+
// https://github.com/actions/toolkit/issues/1578
62022+
core.info('All done. Forcing clean exit to avoid process hanging.')
62023+
process.exit(0)
6201362024
} catch(error) {
6201462025
core.setFailed(error.message)
62026+
process.exit(1)
6201562027
}
6201662028
}
6201762029

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+52-52
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cache-result-action",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Github Action for storing results from previous runs by SHA",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)