Skip to content

Commit

Permalink
feat: combine markdown gen into PR
Browse files Browse the repository at this point in the history
  • Loading branch information
mchristopher committed Sep 25, 2024
1 parent 5b5c728 commit 4e4202a
Show file tree
Hide file tree
Showing 7 changed files with 1,001 additions and 28 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/check_assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Check Asset updates

on:
push:
paths:
- 'assets.json'
- 'assets.gen.json'
pull_request:
paths:
- 'assets.json'
- 'assets.gen.json'

jobs:
generate_assets_md:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Install Python requirements
run: pip install -r requirements.txt

- name: Regenerate asset JSON and markdown
run: |
python generate_assets_json.py
python generate_assets_md.py
- name: Check if assets.gen.json is up-to-date
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
if git diff --exit-code assets.gen.json; then
echo "assets.gen.json is up-to-date."
else
echo "assets.gen.json is not up-to-date with assets.json."
echo "Please run generate_assets_json.py and commit the changes to assets.gen.json."
exit 1
fi
- name: Check if assets.md is up-to-date
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
if git diff --exit-code assets.md; then
echo "assets.md is up-to-date."
else
echo "assets.md is not up-to-date with assets.json."
echo "Please run generate_assets_md.py and commit the changes to assets.md."
exit 1
fi
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
python-version: '3.12'
cache: 'pip'

- name: Install s3cmd tool
- name: Install Python requirements
run: pip install -r requirements.txt

- name: Generate assets JSON
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
.idea
.env
*.gen.json
!assets.gen.json
*.zip
Loading

0 comments on commit 4e4202a

Please sign in to comment.