Skip to content

Commit

Permalink
Merge pull request #4 from lykahb/github-output-env-var
Browse files Browse the repository at this point in the history
Use GITHUB_OUTPUT env variable
  • Loading branch information
lykahb authored Feb 22, 2023
2 parents 1839742 + 36a36b5 commit 6da8a61
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ runs:
run: |
JQ_FILTER='to_entries | group_by(.key=="other") | flatten | .[] | select (.value.fileCount > 0) | "| \(.key) | \(.value.fileCount) | \(.value.additionCount) | \(.value.deletionCount) |"'
COMMENT_BODY=$(echo '${{ inputs.diff-stat }}' | jq --raw-output "$JQ_FILTER")
COMMENT_BODY="${COMMENT_BODY//'%'/'%25'}"
COMMENT_BODY="${COMMENT_BODY//$'\n'/'%0A'}"
COMMENT_BODY="${COMMENT_BODY//$'\r'/'%0D'}"
echo "::set-output name=comment_body::$COMMENT_BODY"
echo "comment_body<<PR_COMMENT_EOF" >> $GITHUB_OUTPUT
echo "$COMMENT_BODY" >> $GITHUB_OUTPUT
echo "PR_COMMENT_EOF" >> $GITHUB_OUTPUT
- if: steps.condition.outputs.passed
uses: peter-evans/create-or-update-comment@v2
id: create-or-update-comment
Expand Down

0 comments on commit 6da8a61

Please sign in to comment.