Skip to content

Commit

Permalink
Adding workflow to run code age periodically
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperFola committed Nov 12, 2024
1 parent 3364ad4 commit 48c3636
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/year-annotate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Run year-annotate weekly

on:
schedule:
- cron: "10 4 1,8,15,22,29 * *"
workflow_dispatch:

jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: ArkScript-lang/Ark
path: arkscript
ref: 'dev'
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- run: pip install --break-system-packages tqdm
- run: sudo apt install -yq gnuplot
- run: |
cd arkscript
python3 ../year-annotate/year-annotate.py -d | tee ../year-annotate/codeage.csv
cd ../year-annotate && gnuplot -p codeage.plot > codeage.svg
env:
GITHUB_TOKEN: ${{ secrets.WEB_API_TOKEN }}
- name: Commit and push
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.STATS_GITHUB_TOKEN }}
run: |
git config --unset-all http.https://github.com/.extraheader
git config user.name "Stats bot"
git config user.email ""
git config remote.origin.url 'https://${{ secrets.STATS_GITHUB_TOKEN }}@github.com/ArkScript-lang/stats.git'
git add -f *.svg
git commit -m "Update stats"
git push -u origin master
1 change: 0 additions & 1 deletion year-annotate/year-annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from itertools import repeat
from multiprocessing import Pool, cpu_count, set_start_method
import tqdm
from packaging.version import Version
from pathlib import Path

# Globals (FIXME: turn this into a proper object)
Expand Down

0 comments on commit 48c3636

Please sign in to comment.