Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisIsManta committed Oct 19, 2023
1 parent 2f747c0 commit 8a5a01f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
16 changes: 12 additions & 4 deletions out/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17773,11 +17773,11 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
command_1.issue("echo", enabled ? "on" : "off");
}
exports.setCommandEcho = setCommandEcho;
function setFailed(message) {
function setFailed2(message) {
process.exitCode = ExitCode.Failure;
error(message);
}
exports.setFailed = setFailed;
exports.setFailed = setFailed2;
function isDebug() {
return process.env["RUNNER_DEBUG"] === "1";
}
Expand Down Expand Up @@ -73865,8 +73865,16 @@ var cache = __toESM(require_cache2());
(async () => {
const resultFilePath = "/tmp/result.json";
core.saveState("result-file-path", resultFilePath);
const found = !!await cache.restoreCache([resultFilePath], core.getInput("cache-key"));
core.setOutput("cache-hit", found);
const cacheHit = !!await cache.restoreCache([resultFilePath], core.getInput("cache-key"));
console.log("cache-hit =", cacheHit);
core.setOutput("cache-hit", cacheHit);
if (cacheHit) {
const result = require(resultFilePath);
console.log("result =", result);
if (result.status === "failure") {
core.setFailed("This job has been failed at " + result.url);
}
}
})();
/*! Bundled license information:

Expand Down
1 change: 1 addition & 0 deletions out/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -78023,6 +78023,7 @@ var mkdirp = Object.assign(async (path2, opts) => {
// src/post.ts
(async () => {
const api = github.getOctokit(core.getInput("github-token"));
console.log("job_id =", github.context.job);
const { data: job } = await api.rest.actions.getJobForWorkflowRun({
...github.context.repo,
job_id: Number(github.context.job)
Expand Down
13 changes: 11 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ void 0;
const resultFilePath = '/tmp/result.json'
core.saveState('result-file-path', resultFilePath)

const found = !!(await cache.restoreCache([resultFilePath], core.getInput('cache-key')))
const cacheHit = !!(await cache.restoreCache([resultFilePath], core.getInput('cache-key')))

core.setOutput('cache-hit', found)
console.log('cache-hit =', cacheHit)
core.setOutput('cache-hit', cacheHit)

if (cacheHit) {
const result = require(resultFilePath)
console.log('result =', result)
if (result.status === 'failure') {
core.setFailed('This job has been failed at ' + result.url)
}
}
})()
1 change: 1 addition & 0 deletions src/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ void 0;
(async () => {
const api = github.getOctokit(core.getInput('github-token'))

console.log('job_id =', github.context.job)
const { data: job } = await api.rest.actions.getJobForWorkflowRun({
...github.context.repo,
job_id: Number(github.context.job),
Expand Down

0 comments on commit 8a5a01f

Please sign in to comment.