Skip to content

Commit

Permalink
Goo
Browse files Browse the repository at this point in the history
  • Loading branch information
iamnafets committed Oct 31, 2023
1 parent 1c13912 commit 8df2a83
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
11 changes: 5 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9612,17 +9612,16 @@ function run() {
}
if (inputs.job) {
const jobs = yield octokit.rest.actions.listJobsForWorkflowRun({ owner, repo, run_id: run.id });
let skip = false;
let foundJob = false;
for (const job of jobs.data.jobs) {
if (job.name === inputs.job) {
if (job.conclusion !== "success") {
core.warning(`Job ${job.name} from run ${run.html_url} is not successful. Skipping.`);
skip = true;
continue;
if (job.conclusion === "success") {
foundJob = true;
break;
}
}
}
if (skip) {
if (!foundJob) {
continue;
}
}
Expand Down
11 changes: 5 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,16 @@ async function run(): Promise<void> {
if(inputs.job) {
const jobs = await octokit.rest.actions.listJobsForWorkflowRun({ owner, repo, run_id: run.id });

let skip = false;
let foundJob = false;
for(const job of jobs.data.jobs) {
if(job.name === inputs.job) {
if(job.conclusion !== "success") {
core.warning(`Job ${job.name} from run ${run.html_url} is not successful. Skipping.`);
skip = true;
continue;
if(job.conclusion === "success") {
foundJob = true;
break;
}
}
}
if(skip) {
if(!foundJob) {
continue;
}
}
Expand Down

0 comments on commit 8df2a83

Please sign in to comment.