Skip to content

Commit

Permalink
Updated for id and body
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyscholl committed Sep 7, 2023
1 parent 768866c commit 94f6aa4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
uses: actions/checkout@v2

- name: Run create-discussion-comment
uses: wesleyscholl/[email protected].17
uses: wesleyscholl/[email protected].18
id: create-comment
with:
discussion-id: 'D_kwDOKEe7W84AVXOO'
Expand Down
19 changes: 6 additions & 13 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,11 @@ runs:
run: |
RESPONSE=$(curl -v -X POST -H "Authorization: bearer ${{inputs.token}}" -H "Content-Type: application/json" -d '{"query": "mutation { addDiscussionComment(input: {body: \"${{inputs.body}}\" discussionId: \"${{inputs.discussion-id}}\" clientMutationId: \"${{inputs.client-mutation-id}}\"}) { clientMutationId comment { id body } } }"}' https://api.github.com/graphql)
echo $RESPONSE
commentid=$($RESPONSE | jq -r '.data.addDiscussionComment.comment.id')
commentbody=$($RESPONSE | jq -r '.data.addDiscussionComment.comment.body')
echo "ID=$commentid" >> "$GITHUB_OUTPUT"
echo "BODY=$commentbody" >> "$GITHUB_OUTPUT"
- name: Get Output Data
shell: bash
env:
ID: ${{ steps.discusscomment.outputs.ID }}
BODY: ${{ steps.discusscomment.outputs.BODY }}
run: |
echo $ID
echo $BODY
echo "Comment ID:"
echo $RESPONSE | jq -r '.data.addDiscussionComment.comment.id'
echo "Comment Body:"
echo $RESPONSE | jq -r '.data.addDiscussionComment.comment.body'


0 comments on commit 94f6aa4

Please sign in to comment.