Skip to content

Commit

Permalink
chore(cli): authenticate GH API request via GitHub token (#1290)
Browse files Browse the repository at this point in the history
  • Loading branch information
steebchen authored Jun 7, 2024
1 parent 656e396 commit 4951597
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions binaries/publish-latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4951597

Please sign in to comment.