Compare commits

...

13 Commits

Author SHA1 Message Date
Michał Rudowicz e6ca247176 let's disable silent and see what we get
/ checkout (push) Successful in 3s Details
/ upload-artifact (push) Failing after 2s Details
2025-02-25 21:06:15 +01:00
Michał Rudowicz ade9dc7611 let's see changing data-binary to data 2025-02-25 20:41:04 +01:00
Michał Rudowicz 0f63361dd9 shell scripting is delightful 2025-02-25 20:36:18 +01:00
Michał Rudowicz d29d2129cb let's see 2025-02-25 20:31:51 +01:00
Michał Rudowicz 22a20ce877 whooopsie 2025-02-25 20:24:58 +01:00
Michał Rudowicz 75afc4c4b8 one step forward, one step back 2025-02-25 20:23:46 +01:00
Michał Rudowicz 81236347bb did i mention that i hate bash 2025-02-25 20:18:10 +01:00
Michał Rudowicz baa2be8410 some light in the tunnel 2025-02-25 20:16:22 +01:00
Michał Rudowicz f2ed70e4cc let's try this way 2025-02-25 20:13:44 +01:00
Michał Rudowicz 957aeaaeff ehh 2025-02-25 20:11:40 +01:00
Michał Rudowicz 7efa3470c6 let's try changing env variable 2025-02-25 20:09:33 +01:00
Michał Rudowicz 29dccddd38 preview what's going to jq 2025-02-25 20:06:19 +01:00
Michał Rudowicz 714f8a33a2 more unescaping 2025-02-25 20:01:28 +01:00
2 changed files with 15 additions and 11 deletions

View File

@ -6,7 +6,7 @@ jobs:
container: container:
image: git.hswro.org/fleg/actions-experiments:latest image: git.hswro.org/fleg/actions-experiments:latest
steps: steps:
- uses: https://codeberg.org/fleg/light-actions/checkout@test2 - uses: https://codeberg.org/fleg/light-actions/checkout@test15
- run: cat README.md - run: cat README.md
upload-artifact: upload-artifact:
runs-on: docker runs-on: docker
@ -14,7 +14,7 @@ jobs:
image: git.hswro.org/fleg/actions-experiments:latest image: git.hswro.org/fleg/actions-experiments:latest
steps: steps:
- run: echo "test passed" > test.txt - run: echo "test passed" > test.txt
- uses: https://codeberg.org/fleg/light-actions/upload-artifact@test2 - uses: https://codeberg.org/fleg/light-actions/upload-artifact@test15
with: with:
path: test.txt path: test.txt
artifact-name: test-artifact artifact-name: test-artifact

View File

@ -13,27 +13,32 @@ runs:
- run: | - run: |
set -euxo pipefail set -euxo pipefail
ARTIFACT_BASE="${ACTIONS_RUNTIME_URL}_apis/pipelines/workflows/${GITHUB_RUN_ID}/artifacts?api-version=6.0-preview" ARTIFACT_BASE="${ACTIONS_RUNTIME_URL}_apis/pipelines/workflows/${GITHUB_RUN_ID}/artifacts?api-version=6.0-preview"
FILE_SIZE_BYTES=$(wc -c < ${{ inputs.path }})
FILE_SIZE_BYTES_MINUS_ONE=$(echo $FILE_SIZE_BYTES - 1 | bc)
FILE_MD5=$(md5sum ${{ inputs.path }} | cut -f1 -d" ")
RESOURCE_URL="$( RESOURCE_URL="$(
curl \ curl \
-XPOST \ -XPOST \
--silent \ --silent \
--fail-with-body \ --fail-with-body \
--header "Authorization: Bearer ${{ github.token }}" \
--header 'Accept: application/json;api-version=6.0-preview' \ --header 'Accept: application/json;api-version=6.0-preview' \
--header \"Authorization: Bearer ${ACTIONS_RUNTIME_TOKEN}\" \
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--data '{\"type\": \"actions_storage\", \"name\": \"${{ inputs.artifact-name }}\"}' \ --data '{"type": "actions_storage", "name": "${{ inputs.artifact-name }}"}' \
\"$ARTIFACT_BASE\" | jq --exit-status --raw-output .fileContainerResourceUrl $ARTIFACT_BASE | jq --exit-status --raw-output .fileContainerResourceUrl
)" )"
curl \ curl \
-XPUT \ -XPUT \
--silent \
--fail-with-body \ --fail-with-body \
--header 'Accept: application/json;api-version=6.0-preview' \ --header 'Accept: application/json;api-version=6.0-preview' \
--header \"Authorization: Bearer ${ACTIONS_RUNTIME_TOKEN}\" \ --header "Authorization: Bearer ${{ github.token }}" \
--header 'Content-Type: application/octet-stream' \ --header 'Content-Type: application/octet-stream' \
--header "Content-Range: bytes 0-$(echo \"$(wc -c < ${{ inputs.path }}) - 1 | wc")/$(wc -c < ${{ inputs.path }})" \ --header "x-tfs-filelength: ${FILE_SIZE_BYTES}" \
--data-binary "@${{ inputs.path }}" \ --header "content-length: ${FILE_SIZE_BYTES}" \
--header "x-actions-results-md5: ${FILE_MD5}" \
--header "Content-Range: bytes 0-${FILE_SIZE_BYTES_MINUS_ONE}/${FILE_SIZE_BYTES}" \
--data-binary @${{ inputs.path }} \
"${RESOURCE_URL}?itemPath=${{ inputs.artifact-name }}/$(basename ${{ inputs.path }})" "${RESOURCE_URL}?itemPath=${{ inputs.artifact-name }}/$(basename ${{ inputs.path }})"
curl \ curl \
@ -41,8 +46,7 @@ runs:
--silent \ --silent \
--fail-with-body \ --fail-with-body \
--header 'Accept: application/json;api-version=6.0-preview' \ --header 'Accept: application/json;api-version=6.0-preview' \
--header \"Authorization: Bearer ${ACTIONS_RUNTIME_TOKEN}\" \ --header "Authorization: Bearer ${{ github.token }}" \
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--data '{"size": 11}' \
"${ARTIFACT_BASE}&artifactName=${{ inputs.artifact-name }}" "${ARTIFACT_BASE}&artifactName=${{ inputs.artifact-name }}"
shell: sh shell: sh