Skip to content

Commit 152c157

Browse files
fix docs to create pr
1 parent 80e54a0 commit 152c157

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

.github/workflows/docs.yaml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ permissions:
1515
contents: write
1616
pages: write
1717
id-token: write
18+
pull-requests: write
1819

1920
concurrency:
2021
group: "pages"
@@ -50,17 +51,24 @@ jobs:
5051
run: |
5152
Set-Location tools
5253
./devdocs-generator.ps1
53-
- name: Commit generated docs
54+
55+
- name: Create Pull Request 🚀
56+
id: cpr
57+
uses: peter-evans/create-pull-request@v6
58+
with:
59+
token: ${{ secrets.GITHUB_TOKEN }}
60+
commit-message: 'Update generated documentation'
61+
title: 'chore: Update Generated Dev Docs'
62+
body: 'Automated update of generated documentation from JSON sources'
63+
branch: docs-update
64+
delete-branch: true
65+
labels: automated
66+
67+
- name: Check outputs
5468
run: |
55-
git config user.name "github-actions[bot]"
56-
git config user.email "github-actions[bot]@users.noreply.github.com"
57-
git add docs/content/dev/
58-
if git diff --staged --quiet; then
59-
echo "No changes to commit"
60-
else
61-
git commit -m "regenerated dev docs from workflow"
62-
git push
63-
fi
69+
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
70+
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
71+
6472
- name: Install Node.js dependencies
6573
run: "cd docs && [[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
6674
- name: Cache Restore

0 commit comments

Comments
 (0)