Supply authorization parameter to toolcache.downloadTool() #1516
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously we supplied the authorization information via the 'headers' parameter and left the
auth
parameterundefined
. This works fine, except in some cases when the request is retried.We observed difference in behaviour, when using
undefined
for theauth
parameter we got a 504 error on the first attempt and a 401 error on the second attempt. When theauth
parameter was set we observed a sequences of 504 errors until the number of retries was exceeded. I'm not really sure where theAuthorization
header got lost, but I suspect the HTTP client drops it when following redirects and the retry-helper doesn't restore it before trying again.In case someone else has similar problems: the underlying cause of the 504 errors were due to proxy settings. When downloading a release artifact from a GitHub Enterprise server (say
github.company.com
) you get redirected tomedia.github.company.com
. Theno_proxy
variable did not contain themedia
subdomain which caused a gateway timeout. Explicitly adding the subdomain to theno_proxy
variable solved the issue. Alternatively the following pull request actions/toolkit#1223 would have solved the issue too, because it updates the no_proxy handling to automatically include subdomains.Merge / deployment checklist