diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index a9915bff..213b1b2b 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -40,17 +40,19 @@ jobs: else if (changedLines > 9) label = 'size:S'; else label = 'size:XS'; - return label; + core.setOutput("size-label", label); - name: Apply size label uses: actions/github-script@v7 - if: steps.calculate-size.outputs.result with: script: | - await github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - labels: [ "${{steps.calculate-size.outputs.result}}" ] - }) + const label = core.getInput('size-label'); + if (label) { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: [label] + }); + }