Skip to content

Commit 94f6aa4

Browse files
committed
Updated for id and body
1 parent 768866c commit 94f6aa4

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

.github/workflows/create-comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
uses: actions/checkout@v2
99

1010
- name: Run create-discussion-comment
11-
uses: wesleyscholl/create-discussion-comment@v1.0.17
11+
uses: wesleyscholl/create-discussion-comment@v1.0.18
1212
id: create-comment
1313
with:
1414
discussion-id: 'D_kwDOKEe7W84AVXOO'

action.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,11 @@ runs:
3333
run: |
3434
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)
3535
echo $RESPONSE
36-
commentid=$($RESPONSE | jq -r '.data.addDiscussionComment.comment.id')
37-
commentbody=$($RESPONSE | jq -r '.data.addDiscussionComment.comment.body')
38-
echo "ID=$commentid" >> "$GITHUB_OUTPUT"
39-
echo "BODY=$commentbody" >> "$GITHUB_OUTPUT"
40-
41-
- name: Get Output Data
42-
shell: bash
43-
env:
44-
ID: ${{ steps.discusscomment.outputs.ID }}
45-
BODY: ${{ steps.discusscomment.outputs.BODY }}
46-
run: |
47-
echo $ID
48-
echo $BODY
36+
echo "Comment ID:"
37+
echo $RESPONSE | jq -r '.data.addDiscussionComment.comment.id'
38+
echo "Comment Body:"
39+
echo $RESPONSE | jq -r '.data.addDiscussionComment.comment.body'
40+
41+
4942

5043

0 commit comments

Comments
 (0)