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"
|
||||
|
|
|
@ -89,7 +89,6 @@ runs:
|
|||
# We get a JSON with an signedUploadUrl similar to :
|
||||
# https://entrepot.xlii.si/twirp/github.actions.results.api.v1.ArtifactService/UploadArtifact?sig=yWWEI8tIIECp8D7E5TVh4_6G2pZxWaVdQcSYaCsx5s0=&expires=2024-08-26+07%3A20%3A49.886890537+%2B0200+CEST&artifactName=mymodule-1.2.3.zip&taskID=63
|
||||
SIGNED_UPLOAD_URL="$( echo "$RESPONSE" | sed -n 's/.*"signed_\?[uU]pload_\?[uU]rl" *: *"\([^"]\+\)".*/\1/p' )"
|
||||
printf "%s" "$SIGNED_UPLOAD_URL" | base64
|
||||
|
||||
# Upload our file
|
||||
# (note: adding '&comp=block' at the end of the URL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue