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

feat: use GITHUB_TOKEN to make it harder to get caught in rate limits #37

Merged
merged 1 commit into from
Jul 21, 2022
Merged
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
17 changes: 6 additions & 11 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@ set -au
get_qpm_download_url() {
local OS_ARCH="$1"

if [ "${CI:-}" = "true" ]; then
curl -sSL https://api.github.com/repos/anoriqq/qpm/releases/latest \
| jq -r '.assets[].browser_download_url' \
| grep "$OS_ARCH" \
| head -n 1
else
curl -sSL -H 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/anoriqq/qpm/releases/latest \
| jq -r '.assets[].browser_download_url' \
| grep "$OS_ARCH" \
| head -n 1
fi
curl -sSL --url https://api.github.com/repos/anoriqq/qpm/releases/latest \
-u ':${{ secrets.GITHUB_TOKEN }}' \
-H 'content-type: application/json' \
| jq -r '.assets[].browser_download_url' \
| grep "$OS_ARCH" \
| head -n 1
}

install() {
Expand Down