Fix runners monitoring workflow: improve reliability and reduce noise#174
Fix runners monitoring workflow: improve reliability and reduce noise#174igorpecovnik merged 1 commit intomainfrom
Conversation
igorpecovnik
commented
Jan 15, 2026
- Remove push trigger (only run scheduled and manual)
- Change schedule from hourly to daily at 6 AM UTC
- Enable and fix concurrency group (runners-status, cancel-in-progress: true)
- Move NETBOX_TOKEN and NETBOX_API to env block for consistency
- Remove duplicate GH_TOKEN variable assignment
- Add set -euo pipefail for proper error handling
- Add error checking for GitHub API calls (gh and curl fallback)
- Add error checking for NetBox API call
- Add validation that received data is not empty
- Fix runner status logic: only show 🟢 for runners with "online" status
- Previously showed 🟢 for any runner with status or "github" label
- Remove push trigger (only run scheduled and manual) - Change schedule from hourly to daily at 6 AM UTC - Enable and fix concurrency group (runners-status, cancel-in-progress: true) - Move NETBOX_TOKEN and NETBOX_API to env block for consistency - Remove duplicate GH_TOKEN variable assignment - Add set -euo pipefail for proper error handling - Add error checking for GitHub API calls (gh and curl fallback) - Add error checking for NetBox API call - Add validation that received data is not empty - Fix runner status logic: only show 🟢 for runners with "online" status - Previously showed 🟢 for any runner with status or "github" label Signed-off-by: Igor Pecovnik <igor@armbian.com>
WalkthroughThis PR modifies the GitHub Actions workflow for monitoring runner status. The trigger schedule changes from push and hourly execution to daily at 06:00 UTC. Concurrency configuration is updated with a new group name and cancel-in-progress set to true. Environment variable handling is simplified with explicit NETBOX_TOKEN and NETBOX_API variables. Script robustness is enhanced with Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/monitoring-runners-status.yml:
- Around line 67-76: The curl fallback that runs the command with GH_TOKEN and
writes to "$runners_nd" only requests per_page=100 and doesn't implement
pagination, so it will miss runners when there are >100; update the fallback
(the curl invocation and its enclosing if/then block) to loop through pages
(e.g., increment a page parameter and append each page's .runners[] into
"$runners_nd" until an empty page or fewer than requested items is returned) or,
if you prefer a minimal change, add a clear comment/log message in that block
documenting the 100-item limit and recommending use of "gh api --paginate" (the
code locations to change are the curl command that calls
"https://api.github.com/orgs/armbian/actions/runners?per_page=100", the
surrounding if/then block that exits on failure, and the variable
"$runners_nd").
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.github/workflows/monitoring-runners-status.yml
🔇 Additional comments (5)
.github/workflows/monitoring-runners-status.yml (5)
5-10: LGTM!Schedule change to daily at 06:00 UTC and the concurrency configuration look good. The
cancel-in-progress: truewill prevent duplicate workflow runs from piling up.
44-47: LGTM!Moving
NETBOX_TOKENandNETBOX_APIto the env block improves consistency, and addingset -euo pipefailis a best practice for catching errors early in shell scripts.
78-81: LGTM!Good defensive check to ensure the runners data file is not empty before proceeding.
93-105: LGTM!Solid error handling for the NetBox API call with
-fsSflags and explicit empty-response validation.
126-132: LGTM! This is the key fix.The updated logic correctly checks both that the runner exists in the lookup (
-n "$runner_status") and that its status is specifically"online"before showing the green indicator. This fixes the false-positive issue described in the PR objectives.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.