Github LOC #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Github LOC | |
| permissions: | |
| contents: write | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| fresh: | |
| description: "Recalculate LOC for all repositories from fresh" | |
| required: false | |
| default: "false" | |
| schedule: | |
| - cron: "0 0 * * 0" # weekly Sunday 00:00 UTC | |
| jobs: | |
| loc: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install requests | |
| - name: Run LOC Analyzer | |
| env: | |
| RepoLoc: ${{secrets.RepoLoc}} | |
| run: | | |
| python scripts/main.py \ | |
| --fresh=${{github.event.inputs.fresh}} | |
| - name: Commit LOC results | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "action@github.com" | |
| git add repo.json loc-summary.json | |
| git commit -m "Update LOC cache and summary" || echo "No changes to commit" | |
| git push |