fix: GitHub Actions workflow update

This commit is contained in:
2026-01-20 19:02:51 -05:00
parent 0f2681f92b
commit e36f1e0bd0

View File

@@ -16,10 +16,16 @@ jobs:
- name: Update README - name: Update README
run: | run: |
LOC=$(grep -o '"total_code":[0-9]*' public/code-stats.json | cut -d: -f2) LOC=$(grep '"total_code"' public/code-stats.json | sed 's/[^0-9]*//g')
if [ -z "$LOC" ] || [ "$LOC" -eq 0 ]; then
echo "Error: Could not parse LOC or LOC is 0. Checking file existence..."
ls -R public/
exit 1
fi
FORMATTED_LOC=$(printf "%'d" $LOC) FORMATTED_LOC=$(printf "%'d" $LOC)
echo "Detected $FORMATTED_LOC lines of code." echo "Detected $FORMATTED_LOC lines of code. Updating README..."
sed -i "s/\(\).*\(\)/\1$FORMATTED_LOC\2/" README.md sed -i "s/\(\).*\(\)/\1$FORMATTED_LOC\2/" README.md
@@ -28,8 +34,10 @@ jobs:
git config user.name "Ares-Bot" git config user.name "Ares-Bot"
git config user.email "ares@beane.me" git config user.email "ares@beane.me"
git add README.md git add README.md
if git diff --staged --quiet; then if git diff --staged --quiet; then
echo "No changes" echo "No changes"
else else
git commit -m "chore: sync code velocity to $FORMATTED_LOC LOC [skip ci]" git commit -m "chore: sync code velocity to $FORMATTED_LOC LOC [skip ci]"
git push http://${{ secrets.GITHUB_TOKEN }}@gitea-http:3000/${{ github.repository }}.git ${{ github.ref_name }} git push http://${{ secrets.GITHUB_TOKEN }}@gitea-http:3000/${{ github.repository }}.git main
fi