From d342062561419bd41f645ae5a81ba51ba17ee3fe Mon Sep 17 00:00:00 2001 From: iacopo Date: Tue, 17 Oct 2023 15:35:33 +0200 Subject: [PATCH] ci: add cloc.yml Count Line Of Code Issue #103 --- .github/workflows/cloc.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/cloc.yml diff --git a/.github/workflows/cloc.yml b/.github/workflows/cloc.yml new file mode 100644 index 0000000..cc0c716 --- /dev/null +++ b/.github/workflows/cloc.yml @@ -0,0 +1,33 @@ +name: Aggiorna statistiche cloc al merge di una PR + +on: + push: + branches: [ main ] +jobs: + cloc: + runs-on: ubuntu-latest + + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write + + steps: + - name: Checkout del codice + uses: actions/checkout@v3 + + - name: Installa cloc + run: | + sudo apt-get update + sudo apt-get install cloc + + - name: Calcola linee di codice + run: | + cloc src --csv --out=lines_of_code.csv --hide-rate + cloc src --out=lines_of_code.txt --hide-rate + + - name: Push changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "Update line count" + file_pattern: "lines_of_code.*" \ No newline at end of file