[macOS] Allow using GitHub PAT to enlarge api requests limit (#4917)

* Use gh api pat

* Add gh token to 10.15

* Add github_api_pat for macos-12
This commit is contained in:
Mikhail Timofeev
2022-01-20 13:41:21 +03:00
committed by GitHub
parent 73ef0e730c
commit cdd8150e00
8 changed files with 28 additions and 7 deletions

View File

@@ -10,7 +10,7 @@ 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 -s "https://api.github.com/repos/ruby/ruby-builder/releases/latest" | jq -r '.assets[].name')
PACKAGE_TAR_NAMES=$(curl -H "Authorization: token $API_PAT" -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"