Skip to content

Commit d84e46b

Browse files
"Update Documentation" workflow - use gh api to create a documentation PR (#459)
1 parent 8d3685e commit d84e46b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/update-documentation.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
jobs:
99
generate:
1010
runs-on: ubuntu-latest
11+
environment: documentation
1112
if: "github.ref == 'refs/heads/main'"
1213
steps:
1314
- uses: actions/checkout@v3
@@ -18,10 +19,10 @@ jobs:
1819
generate-docs: "true"
1920
base-path-to-features: "./src"
2021

21-
- name: Add and Commit Documentation
22+
- name: Create a PR for Documentation
2223
id: push_image_info
2324
env:
24-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
GITHUB_TOKEN: ${{ secrets.PAT }}
2526
run: |
2627
set -e
2728
echo "Start."
@@ -42,5 +43,12 @@ jobs:
4243
# Push
4344
if [ "$NO_UPDATES" != "true" ] ; then
4445
git push origin "$branch"
45-
gh pr create --title "$message" --body "$message"
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'
4654
fi

0 commit comments

Comments
 (0)