More thorough debug workaround #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on https://github.com/marketplace/actions/create-discussion-comment | |
name: enUS Localization Update Announcement | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
paths: | |
- 'Locale/enUS.lua' | |
jobs: | |
localization-update-announcement: | |
# Don't run on forks by default. | |
if: github.repository_owner == 'veechs' | |
permissions: | |
discussions: write | |
env: | |
body: ${{ format('enUS localization updated on {0} branch in {1}.', github.ref_name, github.sha) }} | |
discussionId: D_kwDOJ3GOZc4Aep4W | |
replyToId: ${{ github.ref_name == 'dev' && 'DC_kwDOJ3GOZc4AvO_3' || 'DC_kwDOJ3GOZc4AvO_1' }} | |
clientMutationId: 302201 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Add Discussion Comment | |
shell: bash | |
id: discusscomment | |
run: | | |
RESPONSE=$(curl -v -X POST -H "Authorization: bearer ${{ secrets.GITHUB_TOKEN }}" -H "Content-Type: application/json" -d '{"query": "mutation { addDiscussionComment(input: {body: \"${{env.body}}\" discussionId: \"${{env.discussionId}}\" replyToId: \"${{env.replyToId}}\" clientMutationId: \"${{env.clientMutationId}}\"}) { clientMutationId comment { id body } } }"}' https://api.github.com/graphql) | |
echo $RESPONSE | |
echo "Comment ID:" | |
echo $RESPONSE | jq -r '.data.addDiscussionComment.comment.id' | |
echo "Comment Body:" | |
echo $RESPONSE | jq -r '.data.addDiscussionComment.comment.body' | |
# GraphQL queries to find required data. | |
# https://docs.github.com/en/graphql/overview/explorer | |
# | |
#query { | |
# repository(owner: "<username>", name: "<repository>") { | |
# discussions(first: 5) { | |
# edges { | |
# node { | |
# # number parameter for 2nd query: | |
# number | |
# # discussion-id: | |
# id | |
# title | |
# category { | |
# id | |
# name | |
# } | |
# body | |
# id | |
# } | |
# } | |
# } | |
# } | |
#} | |
# | |
#query{ | |
# repository(owner: "<username>", name: "<repository>") { | |
# discussion(number: 6) { | |
# title | |
# createdAt | |
# # first 100 results | |
# comments(first: 100) { | |
# # edges.node is where the actual 'Comment' object is | |
# edges { | |
# node { | |
# # replyToId: | |
# id | |
# author { | |
# login | |
# url | |
# } | |
# body | |
# } | |
# } | |
# } | |
# } | |
# } | |
#} |