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

Commit

Permalink
ci: github api use token for pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
gabreal committed May 15, 2020
1 parent c7cc94b commit d46a8ec
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit d46a8ec

Please sign in to comment.