mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 14:17:22 +00:00
Make auth optional for nvm and ruby scripts (#5030)
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
###########################################################################
|
||||
source ~/utils/utils.sh
|
||||
|
||||
VERSION=$(curl -H "Authorization: token $API_PAT" -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name')
|
||||
[ -n "$API_PAT" ] && authString=(-H "Authorization: token ${API_PAT}")
|
||||
VERSION=$(curl "${authString[@]}" -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name')
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION/install.sh | bash
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
|
||||
@@ -10,7 +10,8 @@ echo "GEM_PATH=$GEM_PATH" >> "$HOME/.bashrc"
|
||||
echo 'export PATH="$GEM_PATH:/usr/local/opt/ruby@'${DEFAULT_RUBY_VERSION}'/bin:$PATH"' >> "$HOME/.bashrc"
|
||||
|
||||
echo "Install Ruby from toolset..."
|
||||
PACKAGE_TAR_NAMES=$(curl -H "Authorization: token $API_PAT" -s "https://api.github.com/repos/ruby/ruby-builder/releases/latest" | jq -r '.assets[].name')
|
||||
[ -n "$API_PAT" ] && authString=(-H "Authorization: token ${API_PAT}")
|
||||
PACKAGE_TAR_NAMES=$(curl "${authString[@]}" -s "https://api.github.com/repos/ruby/ruby-builder/releases/latest" | jq -r '.assets[].name')
|
||||
TOOLSET_VERSIONS=$(get_toolset_value '.toolcache[] | select(.name | contains("Ruby")) | .versions[]')
|
||||
RUBY_PATH="$AGENT_TOOLSDIRECTORY/Ruby"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user