Skip to content

Commit 04ee10b

Browse files
committed
fix(workflows): fix health check JSON path and change moderation to hourly
- Fix discussion-health-check.yml fallback JSON to use correct GraphQL path (.data.repository.discussions instead of .data.organization.repositoryDiscussions) Fixes: cat: /tmp/clio-workspace/analysis.json: No such file or directory - Change discussion-moderation.yml schedule from every 15 min to hourly (cron: '0 * * * *' instead of '*/15 * * * *')
1 parent b544da2 commit 04ee10b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/discussion-health-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ jobs:
166166
echo "json_valid=true" >> $GITHUB_OUTPUT
167167
else
168168
echo "json_valid=false" >> $GITHUB_OUTPUT
169-
TOTAL=$(jq -r '.data.organization.repositoryDiscussions.totalCount // 0' /tmp/clio-workspace/DISCUSSIONS_DATA.json)
170-
UNANSWERED=$(jq -r '[.data.organization.repositoryDiscussions.nodes[] | select(.isAnswered == false and .category.name == "Q&A")] | length' /tmp/clio-workspace/DISCUSSIONS_DATA.json)
171-
NO_RESPONSE=$(jq -r '[.data.organization.repositoryDiscussions.nodes[] | select(.comments.totalCount == 0)] | length' /tmp/clio-workspace/DISCUSSIONS_DATA.json)
169+
TOTAL=$(jq -r '.data.repository.discussions.totalCount // 0' /tmp/clio-workspace/DISCUSSIONS_DATA.json)
170+
UNANSWERED=$(jq -r '[.data.repository.discussions.nodes[] | select(.isAnswered == false and .category.name == "Q&A")] | length' /tmp/clio-workspace/DISCUSSIONS_DATA.json)
171+
NO_RESPONSE=$(jq -r '[.data.repository.discussions.nodes[] | select(.comments.totalCount == 0)] | length' /tmp/clio-workspace/DISCUSSIONS_DATA.json)
172172
173173
echo "{\"total_open\":$TOTAL,\"unanswered_qa\":$UNANSWERED,\"no_responses\":$NO_RESPONSE,\"health_score\":\"unknown\",\"needs_attention\":$((UNANSWERED + NO_RESPONSE)),\"summary\":\"Automated analysis complete. Manual review recommended.\"}" > /tmp/clio-workspace/analysis.json
174174
echo "Using fallback JSON"

.github/workflows/discussion-moderation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Discussion Moderation with CLIO
22

33
on:
44
schedule:
5-
# Run every 15 minutes
6-
- cron: '*/15 * * * *'
5+
# Run hourly at the top of each hour
6+
- cron: '0 * * * *'
77
workflow_dispatch:
88
inputs:
99
lookback_minutes:

0 commit comments

Comments
 (0)