Skip to content

Commit df7e268

Browse files
fix: ignore inconsistent runs that have a status set to 'in_progress' but conclusion is 'success' (#59)
* Ignore inconsistent runs that have a status set to 'in_progress' but conclusion is 'success' * Bump action node version to 16 * Upgrade dependencies, run npm dedupe * run fmt and build Signed-off-by: Rui Chen <[email protected]> --------- Signed-off-by: Rui Chen <[email protected]> Co-authored-by: gustaff-weldon <[email protected]>
1 parent 63921e5 commit df7e268

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ async function run() {
88
try {
99
const input = parseInput(env);
1010
debug(
11-
`Parsed inputs (w/o token): ${(({ githubToken, ...inputs }) => inputs)(
12-
input,
13-
)}`,
11+
`Parsed inputs (w/o token): ${(({ githubToken, ...inputs }) =>
12+
JSON.stringify(inputs))(input)}`,
1413
);
1514
const github = new OctokitGitHub(input.githubToken);
1615
debug(`Fetching workflows for ${input.owner}/${input.repo}...`);

src/wait.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@ export class Waiter implements Wait {
5757
this.debug(`Found ${runs.length} ${this.workflowId} runs`);
5858
const previousRuns = runs
5959
.filter((run) => run.id < this.input.runId)
60+
.filter((run) => {
61+
const isSuccessful: boolean = run.conclusion === "success";
62+
63+
if (isSuccessful) {
64+
this.debug(
65+
`Skipping run ${run.id}, status: ${run.status}, conclusion: ${run.conclusion}`,
66+
);
67+
}
68+
69+
return !isSuccessful;
70+
})
6071
.sort((a, b) => b.id - a.id);
6172
if (!previousRuns || !previousRuns.length) {
6273
setOutput("force_continued", "");

0 commit comments

Comments
 (0)