Skip to content

Commit ad4a857

Browse files
Olga Zinovevafacebook-github-bot
Olga Zinoveva
authored andcommitted
Fix occasional failures of triage-issue job (#36846)
Summary: I added a new step to the triage-issue job last week, to add descriptive labels to issues based on their title. This job has occasionally be failing, [like this](https://github.com/facebook/react-native/actions/runs/4630279135/jobs/8191646900). This happens when no applicable labels are found, and we send up an empty array to the add labels endpoint. Adding an array length check to protect against this case. ## Changelog: [INTERNAL] [FIXED] - Fixed occasional failures in the issue triage pipeline related to issue labeling Pull Request resolved: #36846 Test Plan: Repro run in my repository before the fix: https://github.com/SlyCaptainFlint/react-native/actions/runs/4631843716 (note that the error is the same as in the example failure listed in the description) And here is a success on the same issue after the fix: https://github.com/SlyCaptainFlint/react-native/actions/runs/4631920441 Reviewed By: cipolleschi Differential Revision: D44866639 Pulled By: cortinico fbshipit-source-id: ace6ebece46d7a160f8be39a6099121e11201318
1 parent 3c9d915 commit ad4a857

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/addDescriptiveLabels.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ module.exports = async (github, context) => {
3737
labelsToAdd.push(topics[topic]);
3838
}
3939
}
40-
41-
await addLabels(labelsToAdd);
40+
if (labelsToAdd.length > 0) {
41+
await addLabels(labelsToAdd);
42+
}
4243
};
4344

4445
const labelAndroid = 'Platform: Android';

0 commit comments

Comments
 (0)