-
Notifications
You must be signed in to change notification settings - Fork 7
46 lines (38 loc) · 1.39 KB
/
update-schemas.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Update Schemas
on:
workflow_dispatch: {} # Manual Trigger
schedule:
- cron: 0 6 * * 1 # Mondays 6AM UTC
permissions:
contents: write # Request write permissions for the workflow
jobs:
update-schemas:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Adjust the Python version as needed
- name: Generate Schemas
run: |
cd site/schemas
curl -o 'requirements.txt' https://raw.githubusercontent.com/BrutuZ/tachibk-converter/main/requirements.txt
pip install -r requirements.txt
curl -o 'generate_schemas.py' https://raw.githubusercontent.com/BrutuZ/tachibk-converter/main/tachibk-converter.py
python generate_schemas.py --dump-schemas
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'Schema Assistant'
git config --global user.email '[email protected]'
git add **/*.proto
# Check if there are any changes
if git diff-index --cached --quiet HEAD --; then
echo "No changes to commit"
else
git commit -m 'Update Protobuf schemas'
git push
fi