From a8d2531877061eb8cde38537542c28bf9bbd22fd Mon Sep 17 00:00:00 2001 From: gabriel Date: Thu, 14 May 2020 22:23:11 +0530 Subject: [PATCH] ci: github api use token for pull requests --- scripts/gitlab/lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/gitlab/lib.sh b/scripts/gitlab/lib.sh index 3d7897a21b93..40e25b823bc2 100755 --- a/scripts/gitlab/lib.sh +++ b/scripts/gitlab/lib.sh @@ -24,7 +24,7 @@ check_tag () { if [ -n "$GITHUB_RELEASE_TOKEN" ]; then tag_out=$(curl -H "Authorization: token $GITHUB_RELEASE_TOKEN" -s "$api_base/$repo/git/refs/tags/$tagver") else - tag_out=$(curl -s "$api_base/$repo/git/refs/tags/$tagver") + tag_out=$(curl -H "Authorization: token $GITHUB_PR_TOKEN" -s "$api_base/$repo/git/refs/tags/$tagver") fi tag_sha=$(echo "$tag_out" | jq -r .object.sha) object_url=$(echo "$tag_out" | jq -r .object.url) @@ -53,7 +53,7 @@ has_label(){ if [ -n "$GITHUB_RELEASE_TOKEN" ]; then out=$(curl -H "Authorization: token $GITHUB_RELEASE_TOKEN" -s "$api_base/$repo/pulls/$pr_id") else - out=$(curl -s "$api_base/$repo/pulls/$pr_id") + out=$(curl -H "Authorization: token $GITHUB_PR_TOKEN" -s "$api_base/$repo/pulls/$pr_id") fi [ -n "$(echo "$out" | tr -d '\r\n' | jq ".labels | .[] | select(.name==\"$label\")")" ] }