Skip to content

Commit 1da4529

Browse files
committed
Refactor documentation update workflow to use peter-evans/create-pull-request action
1 parent d1540c1 commit 1da4529

File tree

1 file changed

+12
-33
lines changed

1 file changed

+12
-33
lines changed

.github/workflows/update-documentation.yml

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,15 @@ jobs:
2222
generate-docs: "true"
2323
base-path-to-features: "./src"
2424

25-
- name: Create a PR for Documentation
26-
id: push_image_info
27-
env:
28-
GITHUB_TOKEN: ${{ secrets.PAT }}
29-
run: |
30-
set -e
31-
echo "Start."
32-
33-
# Configure git and Push updates
34-
git config --global user.email [email protected]
35-
git config --global user.name github-actions
36-
git config pull.rebase false
37-
38-
branch=automated-documentation-update-$GITHUB_RUN_ID
39-
git checkout -b $branch
40-
message='Automated documentation update'
41-
42-
# Add / update and commit
43-
git add */**/README.md
44-
git commit -m 'Automated documentation update [skip ci]' || export NO_UPDATES=true
45-
46-
# Push
47-
if [ "$NO_UPDATES" != "true" ] ; then
48-
git push origin "$branch"
49-
gh api \
50-
--method POST \
51-
-H "Accept: application/vnd.github+json" \
52-
/repos/${GITHUB_REPOSITORY}/pulls \
53-
-f title="$message" \
54-
-f body="$message" \
55-
-f head="$branch" \
56-
-f base='main'
57-
fi
25+
- name: Create Pull Request for Documentation
26+
uses: peter-evans/create-pull-request@v6
27+
with:
28+
app-id: ${{ secrets.DEVCONTAINERS_APP_ID }}
29+
private-key: ${{ secrets.DEVCONTAINERS_APP_CLIENT_SECRET }}
30+
commit-message: Automated documentation update [skip ci]
31+
title: Automated documentation update
32+
body: |
33+
Automated documentation update by the Devcontainers app.
34+
This PR includes updates to README.md files generated by the workflow.
35+
branch: automated-documentation-update-${{ github.run_id }}
36+
base: main

0 commit comments

Comments
 (0)