Skip to content

Commit 0476553

Browse files
committed
exit early if no labels are found
1 parent 3829c94 commit 0476553

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.github/actions-scripts/enterprise-algolia-label.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ const eventPayload = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, '
1212
const labelText = 'sync-english-index-for-'
1313
const labelsArray = eventPayload.pull_request.labels
1414

15+
// Exit early if no labels are on this PR
16+
if (!(labelsArray && labelsArray.length)) {
17+
process.exit(0)
18+
}
19+
1520
// Find the relevant label
1621
const algoliaLabel = labelsArray.find(label => label.startsWith(labelText))
1722

0 commit comments

Comments
 (0)