Skip to content

Commit f4e8de7

Browse files
authored
use curl to rest api instead of gh pr create (#2241)
1 parent e64a212 commit f4e8de7

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ publish_community_operators:
619619
- dd-octo-sts version
620620
- dd-octo-sts debug --scope DataDog --policy datadog-operator.publish-community-bundles
621621
- dd-octo-sts token --scope DataDog --policy datadog-operator.publish-community-bundles > token.txt
622+
- export GITHUB_TOKEN=$(cat token.txt)
622623
- gh auth login --with-token < token.txt
623624
- gh auth setup-git
624625
# create pull request for each marketplace repo

hack/publish-community-bundles.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ create_pr() {
4444
git add -A
4545
git commit -s -m "$message"
4646
git push -f --set-upstream origin "$PR_BRANCH_NAME"
47-
gh pr create --title "$message" \
48-
--body "$body" \
49-
--repo "$ORG"/"$repo" \
50-
--base main
47+
curl -L \
48+
-X POST \
49+
-H "Accept: application/vnd.github+json" \
50+
-H "Authorization: Bearer $GITHUB_TOKEN" \
51+
-H "X-GitHub-Api-Version: 2022-11-28" \
52+
-d "{\"title\":\"$message\",\"body\":\"$body\",\"head\":\"$(git rev-parse --abbrev-ref HEAD)\",\"base\":\"main\"}" \
53+
"https://api.github.com/repos/$ORG/$repo/pulls"
5154
}
5255

5356

0 commit comments

Comments
 (0)