aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamruddhi Khandale <skhandale@microsoft.com>2023-02-22 23:23:22 +0300
committerGitHub <noreply@github.com>2023-02-22 23:23:22 +0300
commitd84e46be47867e596fdd2f2efaefb63f67597a07 (patch)
tree789fb165974af3493fb7a5ea785f0a8104403472
parent8d3685e09f18dd8b0a6bce50abe3e868dac27a69 (diff)
"Update Documentation" workflow - use gh api to create a documentation PR (#459)
-rw-r--r--.github/workflows/update-documentation.yml14
1 files changed, 11 insertions, 3 deletions
diff --git a/.github/workflows/update-documentation.yml b/.github/workflows/update-documentation.yml
index 6d7bb5c..6976e62 100644
--- a/.github/workflows/update-documentation.yml
+++ b/.github/workflows/update-documentation.yml
@@ -8,6 +8,7 @@ on:
jobs:
generate:
runs-on: ubuntu-latest
+ environment: documentation
if: "github.ref == 'refs/heads/main'"
steps:
- uses: actions/checkout@v3
@@ -18,10 +19,10 @@ jobs:
generate-docs: "true"
base-path-to-features: "./src"
- - name: Add and Commit Documentation
+ - name: Create a PR for Documentation
id: push_image_info
env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.PAT }}
run: |
set -e
echo "Start."
@@ -42,5 +43,12 @@ jobs:
# Push
if [ "$NO_UPDATES" != "true" ] ; then
git push origin "$branch"
- gh pr create --title "$message" --body "$message"
+ gh api \
+ --method POST \
+ -H "Accept: application/vnd.github+json" \
+ /repos/${GITHUB_REPOSITORY}/pulls \
+ -f title="$message" \
+ -f body="$message" \
+ -f head="$branch" \
+ -f base='main'
fi