Skip to content

Commit d003fdd

Browse files
committed
Only add labels if the array is not empty
1 parent 8738f1b commit d003fdd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/label-pull-requests.yml renamed to .github/workflows/label-pull-request.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
name: Copy labels from linked issues to PRs
1+
name: Copy labels from linked issues to PR
22
on:
33
pull_request:
44
types: [opened, reopened, edited]
55
permissions: {}
66
jobs:
7-
label_issues:
7+
copy_labels:
8+
name: Copy labels
89
runs-on: ubuntu-latest
910
permissions:
1011
pull-requests: write
@@ -40,7 +41,7 @@ jobs:
4041
.flatMap((node) => node.labels.nodes.map((label) => label.name))))
4142
.filter((label) => !label.startsWith("status:"));
4243
43-
if (labels) {
44+
if (labels.length > 0) {
4445
console.log(`Adding labels to PR: ${labels}`);
4546
await github.rest.issues.addLabels({
4647
issue_number: context.issue.number,

0 commit comments

Comments
 (0)