@@ -61843,6 +61843,14 @@ module.exports = require("path");
61843
61843
61844
61844
/***/ }),
61845
61845
61846
+ /***/ 7282:
61847
+ /***/ ((module) => {
61848
+
61849
+ "use strict";
61850
+ module.exports = require("process");
61851
+
61852
+ /***/ }),
61853
+
61846
61854
/***/ 5477:
61847
61855
/***/ ((module) => {
61848
61856
@@ -61968,6 +61976,7 @@ const core = __nccwpck_require__(2186)
61968
61976
const github = __nccwpck_require__(5438)
61969
61977
const cache = __nccwpck_require__(7799)
61970
61978
const fs = __nccwpck_require__(7147)
61979
+ const process = __nccwpck_require__(7282)
61971
61980
61972
61981
const RESULT_PATH = '/tmp/prev-result'
61973
61982
@@ -61981,14 +61990,13 @@ const run = async () => {
61981
61990
const cacheGroup = core.getInput('cache-group')
61982
61991
const keyPrefix = `cache-result-action-${cacheGroup}-${sha}`
61983
61992
const key = keyPrefix + '-' + Math.floor(Date.now() / 1000)
61984
-
61993
+
61985
61994
await cache.restoreCache([RESULT_PATH], key, [keyPrefix])
61986
61995
61987
61996
let actualResult = inputResult
61988
61997
61989
61998
// True if we have a previous result already.
61990
61999
const cacheHit = !!fs.existsSync(RESULT_PATH)
61991
-
61992
62000
let cacheOutcome = cacheHit ? 'hit' : 'miss'
61993
62001
61994
62002
// 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 () => {
62000
62008
actualResult = fs.readFileSync(RESULT_PATH, { encoding: 'utf8' })
62001
62009
}
62002
62010
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
+
62003
62018
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)
62013
62024
} catch(error) {
62014
62025
core.setFailed(error.message)
62026
+ process.exit(1)
62015
62027
}
62016
62028
}
62017
62029
0 commit comments