This commit is contained in:
parent
e1c23abe1b
commit
94b770a545
1 changed files with 5 additions and 2 deletions
|
@ -79,12 +79,15 @@ runs:
|
|||
$( echo "$ACTIONS_RUNTIME_TOKEN" | sed 's/.*\.\(.*\)\..*/\1/' | base64 -d 2>/dev/null | sed 's/.*Actions.Results:\([^:]\+\):\([^:" ]\+\).*/\1 \2/' )
|
||||
EOF
|
||||
|
||||
# Github compatibility layer: ACTIONS_RESULTS_URL already ends with a '/'
|
||||
ACTIONS_RESULTS_URL="$( echo "$ACTIONS_RESULTS_URL" | sed 's/\/$//' )"
|
||||
|
||||
# Request an upload URL
|
||||
RESPONSE="$( wget -O - \
|
||||
--header 'Content-Type:application/json' \
|
||||
--header "Authorization: Bearer $ACTIONS_RUNTIME_TOKEN" \
|
||||
--post-data "$( printf '{"version":4, "name":"%s", "workflow_run_backend_id":"%s", "workflow_job_run_backend_id":"%s"}' "${{ inputs.name }}" "$WORKFLOW_RUN_BACKEND_ID" "$WORKFLOW_JOB_RUN_BACKEND_ID" )" \
|
||||
"$ACTIONS_RESULTS_URL"twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact
|
||||
"$ACTIONS_RESULTS_URL"/twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact
|
||||
)"
|
||||
# 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
|
||||
|
@ -107,7 +110,7 @@ runs:
|
|||
--header 'Content-Type:application/json' \
|
||||
--header "Authorization: Bearer $ACTIONS_RUNTIME_TOKEN" \
|
||||
--post-data "$( printf '{"hash":"sha256:%s", "name":"%s", "size":"%d", "workflow_run_backend_id":"%s", "workflow_job_run_backend_id":"%s"}' "$( sha256sum $MYUPLOAD | sed 's/[[:space:]]\+.*//' )" "${{ inputs.name }}" "$( stat -c %s $MYUPLOAD )" "$WORKFLOW_RUN_BACKEND_ID" "$WORKFLOW_JOB_RUN_BACKEND_ID" )" \
|
||||
"$ACTIONS_RESULTS_URL"twirp/github.actions.results.api.v1.ArtifactService/FinalizeArtifact
|
||||
"$ACTIONS_RESULTS_URL"/twirp/github.actions.results.api.v1.ArtifactService/FinalizeArtifact
|
||||
)"
|
||||
|
||||
# Store the outputs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue