Fix workflow

This commit is contained in:
clsty
2025-10-09 22:39:40 +08:00
parent 75a84f6ed1
commit 3bb510e910
+21 -19
View File
@@ -4,6 +4,7 @@ on:
push: push:
paths: paths:
- 'dist-arch/**' - 'dist-arch/**'
- '.github/workflows/**'
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@@ -15,23 +16,24 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# https://docs.github.com/en/graphql/reference/mutations#adddiscussioncomment # https://docs.github.com/en/graphql/reference/mutations#adddiscussioncomment
run: | run: |
DISCUSSION_NODE_ID=$(curl -X POST \ DISCUSSION_NODE_ID=$(gh api graphql -f query='
-H "Authorization: Bearer $GH_TOKEN" \ query {
-H "Content-Type: application/json" \ repository( owner: "end-4", name: "dots-hyprland" )
-d '{"query": "query { repository(owner: \"end-4\", name: \"dots-hyprland\") { discussion(number: 2140) { id } } }"}' \ { discussion(number: 2140) { id } }
https://api.github.com/graphql | \ }' | \
jq -r '.data.repository.discussion.id') jq -r '.data.repository.discussion.id')
gh api graphql -f query=' echo "The value of DISCUSSION_NODE_ID is ${DISCUSSION_NODE_ID}."
mutation { gh api graphql -f query='
addDiscussionComment(input:{ mutation {
discussionId: "$DISCUSSION_NODE_ID", addDiscussionComment(input:{
body: "dist-arch/ directory has changed in commit ${{ github.sha }} by ${{ github.actor }}.", discussionId: "$DISCUSSION_NODE_ID",
}) { body: "dist-arch/ directory has changed in commit ${{ github.sha }} by ${{ github.actor }}.",
clientMutationId }) {
comment { clientMutationId
id comment {
body id
} body
} }
} }
' }
'