Created
August 26, 2022 02:20
-
-
Save bergkvist/a92ff2a19c26d6140770285ec24b4ccb to your computer and use it in GitHub Desktop.
Check if personal access token is working for private Python package registry using curl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
pip_index_url="example.com/pypi" | |
private_package="myprivatepackage" | |
personal_access_token="$1" | |
curl -k -s -L -o/dev/null -w"%{http_code}" --url "https://$pip_index_url/$private_package" --header "Authorization: Basic $(printf '%s' "$personal_access_token:" | base64)" | |
# To configure pip to use registry: | |
# export PIP_EXTRA_INDEX_URL="https://$personal_access_token@$pip_index_url" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment