From 17a8389fc4ec14aa3782b2288cb15fbc0309da75 Mon Sep 17 00:00:00 2001 From: DARSAN Date: Sun, 4 Aug 2024 02:24:57 +0530 Subject: [PATCH] LOC workflow added --- .github/workflows/lines-of-code.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/lines-of-code.yaml diff --git a/.github/workflows/lines-of-code.yaml b/.github/workflows/lines-of-code.yaml new file mode 100644 index 0000000..2b6d75b --- /dev/null +++ b/.github/workflows/lines-of-code.yaml @@ -0,0 +1,27 @@ +name: Count Lines of Code + +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + cloc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.7 + + - name: Count Lines of Code (cloc) + uses: djdefi/cloc-action@6 + with: + options: --json --report-file=loc-meta.json + + - name: Commit and push changes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git add loc-meta.json + git commit -m 'LOC updated' + git push