From 49515979d80e44f21298645edb0e6815d3e9041f Mon Sep 17 00:00:00 2001 From: Luca Steeb Date: Fri, 7 Jun 2024 14:57:10 +0200 Subject: [PATCH] chore(cli): authenticate GH API request via GitHub token (#1290) --- .github/workflows/publish-cli.yml | 1 + binaries/publish-latest.sh | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-cli.yml b/.github/workflows/publish-cli.yml index 268048e7..2c5343b8 100644 --- a/.github/workflows/publish-cli.yml +++ b/.github/workflows/publish-cli.yml @@ -24,6 +24,7 @@ jobs: AWS_DEFAULT_REGION: eu-west-1 AWS_ACCESS_KEY_ID: ${{ secrets.PRISMA_CLI_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.PRISMA_CLI_AWS_SECRET_ACCESS_KEY }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} - name: Create Pull Request id: pr uses: peter-evans/create-pull-request@v6 diff --git a/binaries/publish-latest.sh b/binaries/publish-latest.sh index 14401bdf..39358c76 100644 --- a/binaries/publish-latest.sh +++ b/binaries/publish-latest.sh @@ -4,19 +4,19 @@ set -eux url="https://api.github.com/repos/prisma/prisma/releases/latest" -v=$(curl -s "$url" | jq -r .tag_name) +v=$(curl -s "$url" -H 'Authorization: Bearer $GH_TOKEN' | jq -r .tag_name) for i in {1..20}; do if [ "$v" != "null" ]; then break fi - v=$(curl -s "$url" | jq -r .tag_name) + v=$(curl -s "$url" -H 'Authorization: Bearer $GH_TOKEN' | jq -r .tag_name) sleep $i done if [ "$v" = "null" ]; then echo "Could not find latest version" echo "full response:" - curl -s "$url" + curl -s "$url" -H 'Authorization: Bearer $GH_TOKEN' exit 1 fi