File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 deploy :
77 if : ${{ github.ref == 'refs/heads/main' }}
88 runs-on : ubuntu-latest
9+ environment : documentation
910 steps :
1011 - uses : actions/checkout@v3
1112
1415 with :
1516 publish-templates : " true"
1617 base-path-to-templates : " ./src"
17- generate-docs : " false "
18+ generate-docs : " true "
1819
20+ env :
21+ GITHUB_TOKEN : ${{ secrets.PAT_DS_PY_R }}
22+
23+ - name : Create PR for Documentation
24+ id : push_image_info
1925 env :
2026 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
27+ run : |
28+ set -e
29+ echo "Start."
30+
31+ # Configure git and Push updates
32+ git config --global user.email github-actions@github.com
33+ git config --global user.name github-actions
34+ git config pull.rebase false
35+
36+ branch=automated-documentation-update-$GITHUB_RUN_ID
37+ git checkout -b $branch
38+ message='Automated documentation update'
39+
40+ # Add / update and commit
41+ git add */**/README.md
42+ git commit -m 'Automated documentation update [skip ci]' || export NO_UPDATES=true
43+
44+ # Push
45+ if [ "$NO_UPDATES" != "true" ] ; then
46+ git push origin "$branch"
47+ gh api \
48+ --method POST \
49+ -H "Accept: application/vnd.github+json" \
50+ /repos/${GITHUB_REPOSITORY}/pulls \
51+ -f title="$message" \
52+ -f body="$message" \
53+ -f head="$branch" \
54+ -f base='main'
55+ fi
You can’t perform that action at this time.
0 commit comments