File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed
Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ name : " Update Documentation"
2+ on :
3+ push :
4+ branches :
5+ - main
6+ workflow_dispatch :
7+
8+ jobs :
9+ generate :
10+ runs-on : ubuntu-latest
11+ environment : documentation
12+ if : " github.ref == 'refs/heads/main'"
13+ steps :
14+ - uses : actions/checkout@v3
15+
16+ - name : Generate Documentation
17+ uses : devcontainers/action@v1
18+ with :
19+ generate-docs : " true"
20+ base-path-to-features : " ./src"
21+
22+ - name : Create a PR for Documentation
23+ id : push_image_info
24+ env :
25+ GITHUB_TOKEN : ${{ secrets.PAT }}
26+ run : |
27+ set -e
28+ echo "Start."
29+
30+ # Configure git and Push updates
31+ git config --global user.email [email protected] 32+ git config --global user.name github-actions
33+ git config pull.rebase false
34+
35+ branch=automated-documentation-update-$GITHUB_RUN_ID
36+ git checkout -b $branch
37+ message='Automated documentation update'
38+
39+ # Add / update and commit
40+ git add */**/README.md
41+ git commit -m 'Automated documentation update [skip ci]' || export NO_UPDATES=true
42+
43+ # Push
44+ if [ "$NO_UPDATES" != "true" ] ; then
45+ git push origin "$branch"
46+ gh api \
47+ --method POST \
48+ -H "Accept: application/vnd.github+json" \
49+ /repos/${GITHUB_REPOSITORY}/pulls \
50+ -f title="$message" \
51+ -f body="$message" \
52+ -f head="$branch" \
53+ -f base='main'
54+ fi
You can’t perform that action at this time.
0 commit comments