mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 02:21:04 +00:00
ci: github api use token for pull requests (#6037)
This commit is contained in:
committed by
GitHub
parent
ddea306044
commit
27250681bf
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
github_api_substrate_pull_url="https://api.github.com/repos/paritytech/substrate/pulls"
|
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
|
# 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" ; }
|
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" ; }
|
boldcat () { printf "|\n"; while read l; do printf "| \033[1m${l}\033[0m\n"; done; printf "|\n" ; }
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
github_api_substrate_pull_url="https://api.github.com/repos/paritytech/substrate/pulls"
|
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"
|
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
|
# 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" ; }
|
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" ; }
|
boldcat () { printf "|\n"; while read l; do printf "| \033[1m${l}\033[0m\n"; done; printf "|\n" ; }
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
url="https://api.github.com/repos/paritytech/substrate/pulls/${CI_COMMIT_REF_NAME}"
|
url="https://api.github.com/repos/paritytech/substrate/pulls/${CI_COMMIT_REF_NAME}"
|
||||||
echo "[+] API URL: $url"
|
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"
|
echo "[+] Draft state: $draft_state"
|
||||||
|
|
||||||
if [ "$draft_state" = 'true' ]; then
|
if [ "$draft_state" = 'true' ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user