fix: use README template with sed

This commit is contained in:
2026-01-20 19:48:27 -05:00
parent 6fafbd0e2d
commit e86d9e6dcb
2 changed files with 11 additions and 3 deletions

View File

@@ -14,12 +14,20 @@ jobs:
git clone http://gitea-http:3000/${{ github.repository }}.git .
git checkout ${{ github.ref_name }}
- name: Update README
run: |
LOC=$(grep '"total_code"' public/code-stats.json | sed 's/[^0-9]*//g')
export FORMATTED_LOC=$(printf "%'d" $LOC)
FORMATTED_LOC=$(printf "%'d" $LOC)
envsubst < README.template > README.md
echo "Injecting $FORMATTED_LOC into README.template..."
sed "s/REPLACE_ME_LOC/$FORMATTED_LOC/g" README.template > README.md
if [ ! -s README.md ]; then
echo "Error: README.md is empty!"
exit 1
fi
- name: Commit and Push
run: |