Skip to content

Commit d30f097

Browse files
committed
update github action
1 parent 3d72567 commit d30f097

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

.github/workflows/generate_docs.yml

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,44 @@
1-
name: Generate Documentation
1+
name: CI
22

33
on:
44
push:
55
branches:
66
- main
77

88
jobs:
9-
generate-docs:
9+
build:
1010
runs-on: ubuntu-latest
1111

1212
steps:
1313
- name: Checkout repository
1414
uses: actions/checkout@v2
1515

16+
- name: Set up Git user
17+
run: |
18+
git config --global user.name 'github-actions'
19+
git config --global user.email '[email protected]'
20+
1621
- name: Set up Python
1722
uses: actions/setup-python@v2
1823
with:
19-
python-version: "3.x"
24+
python-version: 3.x
2025

2126
- name: Install dependencies
2227
run: |
2328
python -m pip install --upgrade pip
2429
pip install -r scripts/requirements.txt
2530
26-
- name: Run generate_docs.py
31+
- name: Generate documentation
32+
run: python scripts/generate_docs.py
2733
env:
2834
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
29-
run: |
30-
python scripts/generate_docs.py
3135

32-
- name: Commit changes
36+
- name: Commit and push changes
3337
run: |
34-
git config --global user.name 'github-actions'
35-
git config --global user.email '[email protected]'
3638
git add .
37-
git commit -m 'Update documentation with code samples and descriptions'
38-
git push origin main
39+
if git diff-index --quiet HEAD; then
40+
echo "No changes to commit"
41+
else
42+
git commit -m "Update documentation with code samples and descriptions"
43+
git push origin main
44+
fi

0 commit comments

Comments
 (0)