Skip to content

Commit d06c68e

Browse files
committed
fix: When issue update requests fail, immediately halt execution
1 parent f07b08b commit d06c68e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.github/actions/file/src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Finding } from "./types.d.js";
2+
import process from "node:process";
23
import core from "@actions/core";
34
import { Octokit } from '@octokit/core';
45
import { toFindingsMap } from "./toFindingsMap.js"
@@ -31,7 +32,8 @@ export default async function () {
3132
closedIssueUrls.push(response.data.html_url);
3233
core.info(`Closed issue: ${response.data.title} (${repoWithOwner}#${response.data.number})`);
3334
} catch (error) {
34-
core.error(`Failed to close issue for finding: ${error}`);
35+
core.setFailed(`Failed to close issue for finding: ${error}`)
36+
process.exit(1);
3537
}
3638
}
3739
}
@@ -52,7 +54,8 @@ export default async function () {
5254
core.info(`Created issue: ${response.data.title} (${repoWithOwner}#${response.data.number})`);
5355
}
5456
} catch (error) {
55-
core.error(`Failed to open/reopen issue for finding: ${error}`);
57+
core.setFailed(`Failed to open/reopen issue for finding: ${error}`);
58+
process.exit(1);
5659
}
5760
}
5861

.github/actions/fix/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import process from "node:process";
12
import core from "@actions/core";
23
import { Octokit } from '@octokit/core';
34
import { fixIssue } from "./fixIssue.js";
@@ -16,7 +17,8 @@ export default async function () {
1617
await fixIssue(octokit, repoWithOwner, issueUrl);
1718
core.info(`Assigned ${repoWithOwner}#${issueUrl.split('/').pop()} to Copilot!`);
1819
} catch (error) {
19-
core.error(`Failed to assign ${repoWithOwner}#${issueUrl.split('/').pop()} to Copilot: ${error}`);
20+
core.setFailed(`Failed to assign ${repoWithOwner}#${issueUrl.split('/').pop()} to Copilot: ${error}`);
21+
process.exit(1);
2022
}
2123
}
2224
core.info("Finished 'fix' action");

0 commit comments

Comments
 (0)