mirror of
https://github.com/mustbeperfect/definitive-opensource.git
synced 2026-04-17 21:54:05 +02:00
Added stats updator functionality w. GH actions
This commit is contained in:
37
.github/workflows/update-stats.yml
vendored
Normal file
37
.github/workflows/update-stats.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
name: Update Applications Metadata
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 0 * * *' # Every day at midnight UTC
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.x
|
||||
|
||||
- name: Run update script
|
||||
env:
|
||||
GH_API_TOKEN: ${{ secrets.GH_API_TOKEN }}
|
||||
run: |
|
||||
python .source/scripts/maintenance/stats_updator.py
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add source/data/applications.json
|
||||
git commit -m "Auto-update GitHub metadata" || echo "No changes to commit"
|
||||
git push
|
||||
Reference in New Issue
Block a user