Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mghilardelli authored Oct 16, 2024
1 parent d9a403d commit 8fb6782
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,19 @@ jobs:
https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUMBER/labels \
-d "{\"labels\":[\"$LABEL\"]}"
# Update the issue body with the approver's name
# Fetch the current issue body
ISSUE_BODY=$(curl -s \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUMBER)
# Append the checkbox to the existing body
NEW_BODY="$(echo "$ISSUE_BODY" | jq -r '.body')\n- [x] $CHECKBOX"
# Extract the current body and append the checkbox
CURRENT_BODY=$(echo "$ISSUE_BODY" | jq -r '.body')
NEW_BODY="${CURRENT_BODY}\n- [x] ${CHECKBOX}"
# Update the issue with the new body
curl -X PATCH \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUMBER \
-d "{\"body\":\"$NEW_BODY\"}"
-d "{\"body\":\"${NEW_BODY}\"}"

0 comments on commit 8fb6782

Please sign in to comment.