File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 branches :
88 - main
99
10+ permissions :
11+ contents : write
12+
1013jobs :
1114 generate-docs :
1215 runs-on : ubuntu-latest
1316 steps :
14- - uses : actions/checkout@v3
17+ - name : Checkout repository
18+ uses : actions/checkout@v3
19+ with :
20+ token : ${{ secrets.GITHUB_TOKEN }}
1521
16- - uses : actions/setup-python@v4
22+ - name : Setup Python
23+ uses : actions/setup-python@v4
1724 with :
1825 python-version : ' 3.x'
1926
@@ -25,16 +32,26 @@ jobs:
2532 cd vicutils
2633 for file in *.py; do
2734 if [ "$file" != "__init__.py" ]; then
35+ echo "Generating docs for $file"
2836 pdoc --html --force --output-dir . "${file%.py}"
2937 # Move generated HTML to parent directory name
30- mv "${file%.py}"/index.html "${file%.py}.html" 2>/dev/null || true
31- rm -rf "${file%.py}"
38+ if [ -d "${file%.py}" ]; then
39+ mv "${file%.py}"/index.html "${file%.py}.html" 2>/dev/null || true
40+ rm -rf "${file%.py}"
41+ fi
3242 fi
3343 done
44+ cd ..
45+ ls -la vicutils/
3446
3547 - name : Commit and push if changes
3648 run : |
37- git config user.name "Vic-Nas"
38- git config user.email "github-actions@github.com"
49+ git config --local user.name "Vic-Nas"
50+ git config --local user.email "github-actions@github.com"
3951 git add vicutils/*.html
40- git diff --quiet && git diff --staged --quiet || (git commit -m "Auto-generate VicUtils documentation" && git push)
52+ if git diff --staged --quiet; then
53+ echo "No changes to commit"
54+ else
55+ git commit -m "Auto-generate VicUtils documentation [skip ci]"
56+ git push
57+ fi
You can’t perform that action at this time.
0 commit comments