Commit 3f19562
authored
fix: Don’t fail on issues without linked PRs (#473)
This PR fixes the error—
> Unhandled error: TypeError: Cannot use 'in' operator to search for
'source' in undefined
—which has caused “Test” workflow run failures (e.g.
https://github.com/github-community-projects/continuous-ai-for-accessibility-scanner/actions/runs/17551616985).
This PR does 3 things:
1. Removes the use of `in` by replacing it with [optional
chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining).
This moots the error above.
2. Adds support for multiple timeline item nodes, in case other timeline
items are added _before_ the scanner action assigns an issue to Copilot
(i.e. when Copilot coding agent’s PR isn’t the first item).
3. Logs when a linked PR is not found for an issue, to help with future
debugging.1 file changed
+7
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
114 | 112 | | |
115 | 113 | | |
116 | 114 | | |
| |||
0 commit comments