StreamingCommunity/.github/workflows/update-loc-badge.yml
2025-02-06 14:29:48 +01:00

29 lines
858 B
YAML

name: Update Lines of Code Badge
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\"}" > Test/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 Test/Media/loc-badge.json
git commit -m "Update lines of code badge" || echo "No changes to commit"
git push