Use the HEAD method when fetching as it is more efficient and prevents 30-second delay when node exits. #219
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.
As the
fetchRetry
function only seems to be used to find out what thelatest
release is - by letting github.com do a redirect - it would be more efficient to use HEAD rather than GET. This also fixes the issue where I am seeing a 30-second delay whenever the project-piper-action step is used from a workflow on a GitHub Enterprise server when a github.com token is not specified. I will raise a separate issue with details of the 30-second delay and link it to this PR.I appreciate that you may not want to restrict fetch.ts to only being able to do HEAD requests so something a bit more flexible might be required - ie. being able to pass-in the request options to
fetchRetry
. In any case, I would really appreciate if you would consider using a HEAD request in whatever way is most practical.Thanks