mirror of
https://github.com/mustbeperfect/definitive-opensource.git
synced 2026-04-18 00:54:03 +02:00
46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
|
|
name: Generate README
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'source/data/**'
|
|
- 'source/components/**'
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: '0 0 * * *' # Every day at midnight UTC
|
|
|
|
jobs:
|
|
generate:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
persist-credentials: true
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
- name: Install dependencies
|
|
run: pip install -r requirements.txt || true
|
|
|
|
- name: Run script to generate README
|
|
run: python ./source/scripts/generation/readme_generator.py
|
|
|
|
- name: Commit and push changes
|
|
run: |
|
|
git config --global user.name "github-actions[bot]"
|
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
git add source/testing/test.md
|
|
git add readmes/
|
|
git add README.md
|
|
git diff --quiet && git diff --staged --quiet || git commit -m "Generate READMEs"
|
|
git push
|