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/.domain/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/.domain/loc-badge.json git commit -m "Update lines of code badge" || echo "No changes to commit" git push