Skip to content

Commit

Permalink
call addLabels only when labelsToAdd is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
IamLizu committed Aug 2, 2024
1 parent 4a5ca9a commit 0ca7509
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/translation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ jobs:
});
const modifiedLanguages = new Set(files.map(file => file.filename.split('/')[0]));
const labelsToAdd = languages.filter(lang => !modifiedLanguages.has(lang)).map(lang => `requires-translation-${lang}`);
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullRequest.number,
labels: labelsToAdd
});
if (labelsToAdd.length > 0) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullRequest.number,
labels: labelsToAdd
});
}

0 comments on commit 0ca7509

Please sign in to comment.