From 10f3a745f2e5d77da1bb1731f8c1d0ca1e085a4e Mon Sep 17 00:00:00 2001 From: Gabriella Gonzalez Date: Wed, 22 Feb 2023 09:45:34 -0800 Subject: [PATCH] Fix conditional check The output appears to be treated as a string and if you use a string as a boolean value then it's true if non-empty, false if empty. So before this change the condition was always evaluating to true. --- action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index b2c25b1..bff3863 100644 --- a/action.yml +++ b/action.yml @@ -20,14 +20,14 @@ runs: shell: bash run: | echo "passed=$(jq 'to_entries | map(.value) | (map(.additionCount + .deletionCount) | ${{ inputs.minimum-lines }} <= add) and (map (.fileCount) | ${{ inputs.minimum-files }} <= add)' <<< '${{ inputs.diff-stat }}')" >> "${GITHUB_OUTPUT}" - - if: steps.condition.outputs.passed + - if: steps.condition.outputs.passed == 'true' uses: peter-evans/find-comment@v2 id: find-comment with: issue-number: ${{ github.event.pull_request.number }} comment-author: 'github-actions[bot]' body-includes: '' - - if: steps.condition.outputs.passed + - if: steps.condition.outputs.passed == 'true' id: make-comment-body shell: bash run: | @@ -36,7 +36,7 @@ runs: echo "comment_body<> $GITHUB_OUTPUT echo "$COMMENT_BODY" >> $GITHUB_OUTPUT echo "PR_COMMENT_EOF" >> $GITHUB_OUTPUT - - if: steps.condition.outputs.passed + - if: steps.condition.outputs.passed == 'true' uses: peter-evans/create-or-update-comment@v2 id: create-or-update-comment with: