Prevent missing regex_patterns (#15)

This commit is contained in:
Johan 2026-01-10 17:51:12 +02:00 committed by GitHub
parent 599fd6209f
commit 783609d2e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
195 changed files with 1617 additions and 562 deletions

View file

@ -3,6 +3,8 @@ name: Generate
on:
schedule:
- cron: "31 7 * * *"
pull_request:
types: [opened, synchronize]
workflow_dispatch:
jobs:
@ -27,11 +29,32 @@ jobs:
git config --global user.name "Github Actions"
git clone https://github.com/TRaSH-Guides/Guides.git TRaSH-Guides
- name: Install dependencies`
run: uv sync --extra dev
- name: Run Python script
run: |
uv run scripts/generate.py TRaSH-Guides/docs/json .
- name: Check for changes
- name: Run tests
run: |
uv run pytest tests
- name: Check for uncommitted changes (PR)
if: github.event_name == 'pull_request'
run: |
git add regex_patterns/ custom_formats/ profiles/
if ! git diff --staged --quiet; then
echo "❌ Error: Generated files have changes that are not committed."
echo "Please run the generation script locally and commit the changes:"
echo " uv run scripts/generate.py TRaSH-Guides/docs/json ."
git diff --staged --stat
exit 1
fi
echo "✅ No uncommitted changes detected"
- name: Commit and push changes (Scheduled/Manual)
if: github.event_name != 'pull_request'
run: |
git add regex_patterns/ custom_formats/ profiles/
git commit -m "Automated update from GitHub Actions" || echo "No changes to commit"

28
.github/workflows/lint.yml vendored Normal file
View file

@ -0,0 +1,28 @@
name: Lint and Format Check
on:
pull_request:
types: [opened, synchronize]
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install uv
run: pip install uv
- name: Install dev dependencies
run: uv sync --extra dev
- name: Run pylint on scripts
run: uv run pylint scripts tests