feat(triage): add status/bot-triaged label after triage (#7765)

Co-authored-by: Srinath Padmanabhan <srithreepo@google.com>
This commit is contained in:
Srinath Padmanabhan
2025-09-05 06:44:03 -07:00
committed by GitHub
parent 0bc0d23cb3
commit 604a2335dd
2 changed files with 11 additions and 6 deletions

View File

@@ -288,17 +288,19 @@ jobs:
const issueNumber = parseInt(process.env.ISSUE_NUMBER);
const explanation = parsedLabels.explanation || '';
const labelsToSet = parsedLabels.labels_to_set || [];
labelsToSet.push('status/bot-triaged');
// Set labels based on triage result
if (parsedLabels.labels_to_set && parsedLabels.labels_to_set.length > 0) {
if (labelsToSet.length > 0) {
await github.rest.issues.setLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
labels: parsedLabels.labels_to_set
labels: labelsToSet
});
const explanationInfo = explanation ? ` - ${explanation}` : '';
core.info(`Successfully set labels for #${issueNumber}: ${parsedLabels.labels_to_set.join(', ')}${explanationInfo}`);
core.info(`Successfully set labels for #${issueNumber}: ${labelsToSet.join(', ')}${explanationInfo}`);
} else {
// If no labels to set, leave the issue as is
const explanationInfo = explanation ? ` - ${explanation}` : '';

View File

@@ -286,15 +286,18 @@ jobs:
continue;
}
if (entry.labels_to_add && entry.labels_to_add.length > 0) {
const labelsToAdd = entry.labels_to_add || [];
labelsToAdd.push('status/bot-triaged');
if (labelsToAdd.length > 0) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
labels: entry.labels_to_add
labels: labelsToAdd
});
const explanation = entry.explanation ? ` - ${entry.explanation}` : '';
core.info(`Successfully added labels for #${issueNumber}: ${entry.labels_to_add.join(', ')}${explanation}`);
core.info(`Successfully added labels for #${issueNumber}: ${labelsToAdd.join(', ')}${explanation}`);
}
if (entry.labels_to_remove && entry.labels_to_remove.length > 0) {