Skip to content

Github LOC

Github LOC #7

Workflow file for this run

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