fix(ci): use portable LOC formatting in stats workflow
This commit is contained in:
1 parent
17c2e27b84
commit
6acb943adf
1 file changed
+10
-3
@@ -27,8 +27,12 @@ jobs:
|
|||||||
DEBIAN_FRONTEND: noninteractive
|
DEBIAN_FRONTEND: noninteractive
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
if ! command -v jq >/dev/null 2>&1 ||
|
||||||
|
! command -v python3 >/dev/null 2>&1; then
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y --no-install-recommends jq python3
|
apt-get install -y --no-install-recommends jq python3
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Process Statistics and Update README
|
- name: Process Statistics and Update README
|
||||||
run: |
|
run: |
|
||||||
@@ -39,9 +43,12 @@ jobs:
|
|||||||
echo "Global Commit Velocity: $TOTAL_COMMITS"
|
echo "Global Commit Velocity: $TOTAL_COMMITS"
|
||||||
echo "COMMIT_VELOCITY=$TOTAL_COMMITS" >> $GITHUB_ENV
|
echo "COMMIT_VELOCITY=$TOTAL_COMMITS" >> $GITHUB_ENV
|
||||||
|
|
||||||
LOC=$(grep '"total_code"' public/code-stats.json | sed 's/[^0-9]*//g')
|
LOC=$(jq -er '.total_code' public/code-stats.json)
|
||||||
FORMATTED_LOC=$(printf "%'d" $LOC)
|
|
||||||
echo "FORMATTED_LOC=$FORMATTED_LOC" >> $GITHUB_ENV
|
FORMATTED_LOC=$(python3 -c \
|
||||||
|
'import sys; print(f"{int(sys.argv[1]):,}")' "$LOC")
|
||||||
|
|
||||||
|
echo "FORMATTED_LOC=$FORMATTED_LOC" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
python3 scripts/generate_heatmap_svg.py public/heatmap.json public/heatmap.svg
|
python3 scripts/generate_heatmap_svg.py public/heatmap.json public/heatmap.svg
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user