From 27250681bf36b581b9b5804f44be3b05ecf65c23 Mon Sep 17 00:00:00 2001 From: gabriel klawitter <gabreal@users.noreply.github.com> Date: Fri, 15 May 2020 11:34:16 +0530 Subject: [PATCH] ci: github api use token for pull requests (#6037) --- substrate/.maintain/gitlab/check_polkadot_companion_build.sh | 2 +- substrate/.maintain/gitlab/check_polkadot_companion_status.sh | 2 +- substrate/.maintain/gitlab/skip_if_draft.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/substrate/.maintain/gitlab/check_polkadot_companion_build.sh b/substrate/.maintain/gitlab/check_polkadot_companion_build.sh index a0850764495..281fa8e1e8d 100755 --- a/substrate/.maintain/gitlab/check_polkadot_companion_build.sh +++ b/substrate/.maintain/gitlab/check_polkadot_companion_build.sh @@ -12,7 +12,7 @@ github_api_substrate_pull_url="https://api.github.com/repos/paritytech/substrate/pulls" # use github api v3 in order to access the data without authentication -github_header="Accept: application/vnd.github.v3+json" +github_header="Authorization: token ${GITHUB_PR_TOKEN}" boldprint () { printf "|\n| \033[1m${@}\033[0m\n|\n" ; } boldcat () { printf "|\n"; while read l; do printf "| \033[1m${l}\033[0m\n"; done; printf "|\n" ; } diff --git a/substrate/.maintain/gitlab/check_polkadot_companion_status.sh b/substrate/.maintain/gitlab/check_polkadot_companion_status.sh index 5387e68f25c..b781831055b 100755 --- a/substrate/.maintain/gitlab/check_polkadot_companion_status.sh +++ b/substrate/.maintain/gitlab/check_polkadot_companion_status.sh @@ -7,7 +7,7 @@ github_api_substrate_pull_url="https://api.github.com/repos/paritytech/substrate/pulls" github_api_polkadot_pull_url="https://api.github.com/repos/paritytech/polkadot/pulls" # use github api v3 in order to access the data without authentication -github_header="Accept: application/vnd.github.v3+json" +github_header="Authorization: token ${GITHUB_PR_TOKEN}" boldprint () { printf "|\n| \033[1m${@}\033[0m\n|\n" ; } boldcat () { printf "|\n"; while read l; do printf "| \033[1m${l}\033[0m\n"; done; printf "|\n" ; } diff --git a/substrate/.maintain/gitlab/skip_if_draft.sh b/substrate/.maintain/gitlab/skip_if_draft.sh index a234a6c18e2..cf6ea6a5b31 100755 --- a/substrate/.maintain/gitlab/skip_if_draft.sh +++ b/substrate/.maintain/gitlab/skip_if_draft.sh @@ -2,7 +2,7 @@ url="https://api.github.com/repos/paritytech/substrate/pulls/${CI_COMMIT_REF_NAME}" echo "[+] API URL: $url" -draft_state=$(curl "$url" | jq -r .draft) +draft_state=$(curl -H "Authorization: token ${GITHUB_PR_TOKEN}" "$url" | jq -r .draft) echo "[+] Draft state: $draft_state" if [ "$draft_state" = 'true' ]; then -- GitLab