Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

ci: github api use token for pull requests #1099

Merged
merged 1 commit into from
May 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/gitlab/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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\")")" ]
}
Expand Down