From 3a310d465b0ba303458119cf38045abf212a7829 Mon Sep 17 00:00:00 2001 From: "Felix T.J. Dietrich" Date: Sun, 11 Aug 2024 20:57:07 +0200 Subject: [PATCH] Fix labeler workflow (#50) --- .github/workflows/pr-labeler.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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] + }); + }