Skip to content

Commit cf100c4

Browse files
committed
more complex comments
1 parent 540ac84 commit cf100c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/scripts/process-stale-discussions.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,11 @@ cat discussions.json | jq -r --arg staleCutoff "$STALE_CUTOFF" --arg warningMess
213213

214214
# Add a warning comment to the discussion
215215
echo " Adding warning comment..."
216-
gh api graphql -f query='mutation($discussionId: ID!, $body: String!) { addDiscussionComment(input: {discussionId: $discussionId, body: $body}) { comment { id } } }' -f discussionId="$DISCUSSION_ID" -f body="$WARNING_MESSAGE"
216+
if ! gh api graphql -f query='mutation($discussionId: ID!, $body: String!) { addDiscussionComment(input: {discussionId: $discussionId, body: $body}) { comment { id } } }' -f discussionId="$DISCUSSION_ID" -f body="$WARNING_MESSAGE"; then
217+
echo " Error: Failed to add warning comment for discussion #$DISCUSSION_NUMBER. Skipping this discussion."
218+
echo ""
219+
continue
220+
fi
217221
fi
218222

219223
echo ""

0 commit comments

Comments
 (0)