Skip to content

Commit

Permalink
Replace gh cli command with curl
Browse files Browse the repository at this point in the history
  • Loading branch information
dannymidnight committed Nov 20, 2023
1 parent 7d54a33 commit d1a7f6a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .buildkite/update_graphql_docs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,5 @@ git commit -m "Update GraphQL docs"
git push -u origin $BRANCH

echo "+++ Create pull request"
gh pr create \
--title "Update GraphQL docs" \
--body "This is an automated PR based on the current GraphQL schema" \
| buildkite-agent annotate --style "success"
create_pull_request "Update GraphQL docs" "This is an automated PR based on the current GraphQL schema" \
| jq ".url" | buildkite-agent annotate --style "success"
10 changes: 10 additions & 0 deletions bin/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,13 @@ function post_github_comment() {
--data "{\"body\":\"$2\"}" \
https://api.github.com/repos/buildkite/docs/issues/$1/comments
}

function create_pull_request() {
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
--data "{\"title\":\"$1\", "body\":\"$2\"}" \
https://api.github.com/repos/buildkite/docs/pulls"
}

0 comments on commit d1a7f6a

Please sign in to comment.