Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cli): authenticate GH API request via GitHub token #1290

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading