diff --git a/.github/workflows/generate-runners-status.yml b/.github/workflows/generate-runners-status.yml index b856dcf..0834f06 100644 --- a/.github/workflows/generate-runners-status.yml +++ b/.github/workflows/generate-runners-status.yml @@ -60,7 +60,8 @@ jobs: for s in ${SERVERS}; do IFS=' ' read -r NAME CPU MEM DISK RUNNERS ID<<< "$(curl -s -H "Authorization: Token ${{ secrets.NETBOX_TOKEN }}" -H "Accept: application/json; indent=4" \ "${{ secrets.NETBOX_API }}/virtualization/virtual-machines/?id=$s" | jq -r '.results[] | .name,.vcpus,.memory,.disk,.custom_fields["runners"],.id' | xargs -n6 -d'\n')" - printf "%s%3d%d%d%d\n" $NAME ${CPU/.*/} $MEM $DISK $RUNNERS >> $GITHUB_STEP_SUMMARY + CALC_MEM=$(echo $MEM | awk '{$1/=1024;printf "%.0f\n",$1}') + printf "%s%3d%d%d%d\n" $NAME ${CPU/.*/} $CALC_MEM $DISK $RUNNERS >> $GITHUB_STEP_SUMMARY unset IFS echo -e "" >> $GITHUB_STEP_SUMMARY for runner in $(seq -f "%02g" 1 $RUNNERS | sed -e "s/.*/$NAME-&/"); do @@ -69,4 +70,4 @@ jobs: done echo -e "" >> $GITHUB_STEP_SUMMARY done - echo "" >> $GITHUB_STEP_SUMMARY \ No newline at end of file + echo "" >> $GITHUB_STEP_SUMMARY