Let's check if we broke something with Forgejo...
Some checks failed
/ GenerateReleaseZipfile (push) Failing after 1m13s
Some checks failed
/ GenerateReleaseZipfile (push) Failing after 1m13s
This commit is contained in:
parent
b14dcb5268
commit
e1c23abe1b
2 changed files with 8 additions and 2 deletions
|
@ -72,8 +72,15 @@ jobs:
|
|||
# TODO : can't get it to work :-/
|
||||
#wget --header "Authorization: Bearer $GITHUB_TOKEN" -O "$DOWNLOAD_FILE" "${{ steps.uploading.outputs.artifact-url }}"
|
||||
|
||||
# Oh boy... We're gone beyond salvation but let's try to explain:
|
||||
# - the api.github.com accepts the GITHUB_TOKEN in the Authorization
|
||||
# header (but not the ACTIONS_RUNTIME_TOKEN, nor the GITHUB_TOKEN as
|
||||
# part of the URL like https://$GITHUB_TOKEN@api.github.com/...)
|
||||
# - ...but we get redirect to Windows.net/Azure data warehouse which refuses GITHUB_TOKEN...
|
||||
# -> so, if the api.github.com fails, we try to extract the redirect location and hit it without any header.
|
||||
# ('beginning to wonder if Github's changing master to main was also a part of a plot to complexify our lives...)
|
||||
TMP_WGET_OUTPUT="$( mktemp )"
|
||||
wget -O "$DOWNLOAD_FILE" --header "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/$GITHUB_REPOSITORY/actions/artifacts/${{ steps.uploading.outputs.artifact-id }}/zip" 2>"$TMP_WGET_OUTPUT" || (
|
||||
wget -O "$DOWNLOAD_FILE" --header "Authorization: Bearer $GITHUB_TOKEN" "https://api.github.com/repos/$GITHUB_REPOSITORY/actions/artifacts/${{ steps.uploading.outputs.artifact-id }}/zip" 2>"$TMP_WGET_OUTPUT" || (
|
||||
wget -O "$DOWNLOAD_FILE" "$( sed -n 's/^Location: \(.*\) \[following\]/\1/p' "$TMP_WGET_OUTPUT" | tail -n 1 )"
|
||||
)
|
||||
unzip "$DOWNLOAD_FILE"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue