From a7e5755188c596482e41f1567bbc5e8165cc8c34 Mon Sep 17 00:00:00 2001 From: gabriel klawitter Date: Fri, 15 May 2020 16:56:02 +0530 Subject: [PATCH] ci: github api use token for pull requests (#1099) --- 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\")")" ] }