Skip to content

Commit cce5ab3

Browse files
committed
Add null check for environment parsing in test-failure-detector
Signed-off-by: Hanxi Zhang <hanxizh@amazon.com>
1 parent 574c8de commit cce5ab3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/test-failure-detector.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,9 @@ jobs:
205205
console.log(`Found existing issue #${existing.number} for ${failure.name}`);
206206
207207
const envMatch = existing.body.match(/\*\*Environments:\*\*\s*(.+)/);
208-
const existingEnvs = envMatch
209-
? envMatch[1].match(/`([^`]+)`/g).map(e => e.replace(/`/g, ''))
208+
const envInner = envMatch ? envMatch[1].match(/`([^`]+)`/g) : null;
209+
const existingEnvs = envInner
210+
? envInner.map(e => e.replace(/`/g, ''))
210211
: [];
211212
212213
const newEnvs = envList.filter(e => !existingEnvs.includes(e));

0 commit comments

Comments
 (0)