-
-
Notifications
You must be signed in to change notification settings - Fork 9
Display self hosted runners status #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4c99e46
d07fead
98b0f3c
c7f026a
d674873
2cf745b
733c4fd
9796115
49ba35e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,138 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: "Generate runners status" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| schedule: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - cron: '0 * * * *' # Run every hour | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: # Manually triggered via GitHub Actions UI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #concurrency: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # group: redirector | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # cancel-in-progress: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Check: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: "Check permissions" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: "ubuntu-22.04" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: "Check permissions" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: armbian/actions/team-check@main | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ORG_MEMBERS: ${{ secrets.ORG_MEMBERS }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TEAM: "Release manager" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+15
to
+27
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Scheduled runs will always fail the Check job On schedule, the actor is github-actions[bot], not a human team member, so team-check fails and blocks build. Gate Check to non-scheduled events (or invert needs on build). Check:
+ if: github.event_name != 'schedule'
name: "Check permissions"
runs-on: "ubuntu-22.04"
steps:
- name: "Check permissions"
- uses: armbian/actions/team-check@main
+ uses: armbian/actions/team-check@main📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: "Get self hosted runners status" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-24.04 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs: Check | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: "Install dependencies: jq" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: awalsh128/cache-apt-pkgs-action@latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| packages: jq | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| version: 1.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+34
to
+39
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Avoid @latest; either pin by SHA or use apt-get directly Pin the action or switch to native apt for simplicity. - - name: "Install dependencies: jq"
- uses: awalsh128/cache-apt-pkgs-action@latest
- with:
- packages: jq
- version: 1.0
+ - name: "Install jq"
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y jq📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: "Get runners from ORG" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GH_TOKEN: ${{ secrets.RUNNERS }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GH_TOKEN=${{ secrets.RUNNERS }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| NETBOX_TOKEN=${{ secrets.NETBOX_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| NETBOX_API=${{ secrets.NETBOX_API }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tmp="$(mktemp -d)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| trap 'rm -rf "$tmp"' EXIT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runners_nd="$tmp/runners.ndjson" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| out_html="$tmp/runners_summary.html" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| : > "$runners_nd" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+49
to
+55
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Harden script execution Enable strict mode; drop unused out_html var. tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
runners_nd="$tmp/runners.ndjson"
- out_html="$tmp/runners_summary.html"
: > "$runners_nd"
+ set -Eeuo pipefail📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Fetch ALL GitHub org runners (prefer gh; fallback to curl) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if command -v gh >/dev/null 2>&1; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gh api \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -H "Accept: application/vnd.github+json" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --paginate /orgs/armbian/actions/runners \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -q '.runners[]' > "$runners_nd" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -fsSL \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -H "Accept: application/vnd.github+json" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -H "Authorization: Bearer ${GH_TOKEN}" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "https://api.github.com/orgs/armbian/actions/runners?per_page=100" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | jq -c '.runners[]' > "$runners_nd" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+56
to
+71
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Curl fallback fetches only first page (misses >100 runners) Paginate until empty or Link header exhausted. else
- curl -fsSL \
- -H "Accept: application/vnd.github+json" \
- -H "Authorization: Bearer ${GH_TOKEN}" \
- -H "X-GitHub-Api-Version: 2022-11-28" \
- "https://api.github.com/orgs/armbian/actions/runners?per_page=100" \
- | jq -c '.runners[]' > "$runners_nd"
+ page=1
+ while :; do
+ resp="$(curl -fsSL \
+ -H "Accept: application/vnd.github+json" \
+ -H "Authorization: Bearer ${GH_TOKEN}" \
+ -H "X-GitHub-Api-Version: 2022-11-28" \
+ "https://api.github.com/orgs/armbian/actions/runners?per_page=100&page=${page}")"
+ count="$(jq '.runners | length' <<<"$resp")"
+ [[ "${count}" -eq 0 ]] && break
+ jq -c '.runners[]' <<<"$resp" >> "$runners_nd"
+ page=$((page+1))
+ done
fi📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Build lookup maps | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| declare -A RUNNER_STATUS RUNNER_BUSY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| while IFS=$'\t' read -r name status busy; do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUNNER_STATUS["$name"]="$status" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUNNER_BUSY["$name"]="$busy" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| done < <(jq -r '[.name, .status, (.busy|tostring)] | @tsv' "$runners_nd") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Fetch NetBox VMs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nb_json="$tmp/netbox.json" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -s \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -H "Authorization: Token ${NETBOX_TOKEN}" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -H "Accept: application/json; indent=4" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "${NETBOX_API}/virtualization/virtual-machines/?limit=500&name__empty=false&tag=github-runner&status=active" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > "$nb_json" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Render to stdout and to HTML file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "<table border=0>" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "<tr><th align=left>Server</th><th align=left>Runner label</th><th align=right>CPU cores</th><th align=right>Memory GB</th><th align=right>Storage GB</th><th align=right>Runners</th></tr>" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # init totals | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| total_cpu=0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| total_mem_gb=0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| total_storage_gb=0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| total_runners=0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| while IFS=$'\t' read -r NAME CPU MEM_MB DISK_GB RUNNERS LABELS ID; do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CALC_MEM=$(( (MEM_MB + 512) / 1024 )) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| printf "<tr><td>%s</td><td>%s</td><td align=right>%d</td><td align=right>%d</td><td align=right>%d</td><td align=right>%d</td></tr>\n" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "$NAME" "$LABELS" "$CPU" "$CALC_MEM" "$DISK_GB" "$RUNNERS" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+88
to
+101
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Escape HTML and quote file path Names/labels from NetBox may contain special chars; escape to avoid broken markup. Also quote $GITHUB_STEP_SUMMARY. - echo "<table border=0>" >> $GITHUB_STEP_SUMMARY
- echo "<tr><th align=left>Server</th><th align=left>Runner label</th><th align=right>CPU cores</th><th align=right>Memory GB</th><th align=right>Storage GB</th><th align=right>Runners</th></tr>" >> $GITHUB_STEP_SUMMARY
+ echo "<table border=0>" >> "$GITHUB_STEP_SUMMARY"
+ echo "<tr><th align=left>Server</th><th align=left>Runner label</th><th align=right>CPU cores</th><th align=right>Memory GB</th><th align=right>Storage GB</th><th align=right>Runners</th></tr>" >> "$GITHUB_STEP_SUMMARY"
@@
- printf "<tr><td>%s</td><td>%s</td><td align=right>%d</td><td align=right>%d</td><td align=right>%d</td><td align=right>%d</td></tr>\n" \
- "$NAME" "$LABELS" "$CPU" "$CALC_MEM" "$DISK_GB" "$RUNNERS" >> $GITHUB_STEP_SUMMARY
+ esc_name=$(jq -Rr @html <<<"$NAME")
+ esc_labels=$(jq -Rr @html <<<"$LABELS")
+ printf "<tr><td>%s</td><td>%s</td><td align=right>%d</td><td align=right>%d</td><td align=right>%d</td><td align=right>%d</td></tr>\n" \
+ "$esc_name" "$esc_labels" "$CPU" "$CALC_MEM" "$DISK_GB" "$RUNNERS" >> "$GITHUB_STEP_SUMMARY"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "<tr><td colspan=6>" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [[ "$RUNNERS" -gt 0 ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for i in $(seq -f "%02g" 1 "$RUNNERS"); do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rn="${LABELS}-${i}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [[ -n "${RUNNER_STATUS[$rn]:-}" || "$LABELS" == "github" ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| printf "🟢" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| printf "🔴 <small>(%s)</small> " "$i" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "</td></tr>" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+103
to
+114
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don’t mark offline runners as green; use real status (+busy) and quote path Presence in the API isn’t “online”. Render online/idle/busy vs offline. - echo "<tr><td colspan=6>" >> $GITHUB_STEP_SUMMARY
+ echo "<tr><td colspan=6>" >> "$GITHUB_STEP_SUMMARY"
if [[ "$RUNNERS" -gt 0 ]]; then
for i in $(seq -f "%02g" 1 "$RUNNERS"); do
rn="${LABELS}-${i}"
- if [[ -n "${RUNNER_STATUS[$rn]:-}" || "$LABELS" == "github" ]]; then
- printf "🟢" >> $GITHUB_STEP_SUMMARY
- else
- printf "🔴 <small>(%s)</small> " "$i" >> $GITHUB_STEP_SUMMARY
- fi
+ status="${RUNNER_STATUS[$rn]:-}"
+ busy="${RUNNER_BUSY[$rn]:-false}"
+ if [[ "$LABELS" == "github" ]]; then
+ icon="🟢"
+ elif [[ "$status" == "online" ]]; then
+ icon="🟢"
+ elif [[ -n "$status" ]]; then
+ icon="🟡"
+ else
+ icon="🔴"
+ fi
+ [[ "$busy" == "true" ]] && icon="${icon}🔥"
+ printf "%s <small>(%s)</small> " "$icon" "$i" >> "$GITHUB_STEP_SUMMARY"
done
fi
- echo "</td></tr>" >> $GITHUB_STEP_SUMMARY
+ echo "</td></tr>" >> "$GITHUB_STEP_SUMMARY"📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # accumulate totals (note: no $ needed for CPU/RUNNERS inside arithmetic) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| total_cpu=$(( total_cpu + CPU )) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| total_mem_gb=$(( total_mem_gb + CALC_MEM )) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| total_storage_gb=$(( total_storage_gb + DISK_GB )) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| total_runners=$(( total_runners + RUNNERS )) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| done < <(jq -r ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .results[] | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ((.vcpus // 0) | floor), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ((.memory // 0) | floor), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ((.disk // 0) | floor), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (.custom_fields["runners"] // 0), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (.custom_fields["labels"] // "null"), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .id | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ] | @tsv | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ' "$nb_json") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # summary row | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| printf "<tr><th colspan=2 align=right>Totals:</th><th align=right>%d</th><th align=right>%d</th><th align=right>%d</th><th align=right>%d</th></tr>\n" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "$total_cpu" "$total_mem_gb" "$total_storage_gb" "$total_runners" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "</table>" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.