2025-02-07 15:15:53 +01:00

29 lines
858 B
YAML

name: Update Lines of Code
on:
schedule:
- cron: '0 0 * * 0'
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