Skip to content

Commit

Permalink
fix pr number on new comment
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-mm committed Nov 2, 2023
1 parent 4a9e053 commit be09ba3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ runs:
name: Minimize Old Comment and Post New Comment
id: minimize-comment
shell: bash
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
COMMENTS=$(curl -s -H "Authorization: Bearer ${{github.token}}" "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments")
COMMENTS=$(curl -s -H "Authorization: Bearer ${{github.token}}" "https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/comments")
# Use jq to parse the comments and get comments made by this bot
echo "$COMMENTS" | jq -c --arg username "github-actions[bot]" '.[] | select(.user.login == $username)' | while read -r comment; do
Expand All @@ -171,7 +173,8 @@ runs:
done
NEW_COMMENT=$(cat "/tmp/eco-ci/output-pr.txt" | jq -Rs '.')
echo "DMM --"
echo $NEW_COMMENT
API_URL="${{ github.api_url }}/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"
curl -X POST -H "Authorization: Bearer ${{github.token}}" -d @- $API_URL <<EOF
{
Expand Down

0 comments on commit be09ba3

Please sign in to comment.