2025-02-07 20:32:20 +01:00

27 lines
822 B
YAML

name: Update Lines of Code
on:
workflow_dispatch:
jobs:
update-loc-badge:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install cloc
run: sudo apt-get install -y cloc
- name: Count Lines of Code
run: |
LOC=$(cloc . --json | jq '.SUM.code')
echo "{\"schemaVersion\": 1, \"label\": \"Lines of Code\", \"message\": \"$LOC\", \"color\": \"green\"}" > .github/media/loc-badge.json
- name: Commit and Push LOC Badge
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "actions@github.com"
git add .github/media/loc-badge.json
git commit -m "Update lines of code badge" || echo "No changes to commit"
git push