Commit 4374ef4
authored
fix: When issue updates fail, immediately halt execution (#23)
Fixes the issue I flagged in
github/continuous-ai-for-accessibility#18 (comment)
(Hubber access only):
> I discovered today that workflows can be green even if “File” fails to
file anything (e.g. if you provide a `token` without “contents: write”
access to the provided `repository`):
https://github.com/github/accessibility-sandbox/actions/runs/17081630847
[(Hubber access only)]
This PR makes it so that—as soon as issue closure, creation, reopen, or
assignment fails—the workflow exits immediately (i.e. subsequent issue
updates are not attempted) and when it exits, it is red.
Implementation details:
-
[`core.error`](https://github.com/actions/toolkit/blob/227b1ce741a925ae9f5fdef91fd10415f2d0ca45/packages/core/src/core.ts#L270-L284)
— note this neither sets an exit code nor exits the process.
-
[`core.setFailed`](https://github.com/actions/toolkit/blob/227b1ce741a925ae9f5fdef91fd10415f2d0ca45/packages/core/src/core.ts#L240-L249)
— note this calls `core.error` and sets an exit code, but it _doesn’t_
exit the process.2 files changed
+8
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
55 | | - | |
| 57 | + | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | | - | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
0 commit comments