mirror of
https://github.com/actions/download-artifact.git
synced 2026-03-11 11:37:54 +08:00
Compare commits
3 Commits
main
...
danwkenned
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
113849fd10 | ||
|
|
afb5733147 | ||
|
|
88b0a35773 |
33
.github/workflows/test.yml
vendored
33
.github/workflows/test.yml
vendored
@@ -154,3 +154,36 @@ jobs:
|
||||
}
|
||||
Write-Host "Successfully downloaded artifact without decompressing: $rawFile (size: $($fileInfo.Length) bytes)"
|
||||
shell: pwsh
|
||||
|
||||
# Regression test for artifact filename vs content-type mismatch
|
||||
# When an archived artifact has a name with a file extension that doesn't
|
||||
# match the blob type (e.g. "report.txt" but blob is zip), the server
|
||||
# should append .zip to the content-disposition filename.
|
||||
- name: Create and upload archived artifact with misleading extension
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p path/to/extension-test
|
||||
echo '{"key": "value"}' > path/to/extension-test/data.json
|
||||
- uses: actions/upload-artifact@v4 # V4 is important here to ensure we're supporting older versions correctly
|
||||
with:
|
||||
name: report.txt-${{ matrix.runs-on }}.json
|
||||
path: path/to/extension-test/data.json
|
||||
|
||||
- name: Download misleading-extension artifact without decompressing
|
||||
uses: ./
|
||||
with:
|
||||
name: report.txt-${{ matrix.runs-on }}.json
|
||||
path: ext-test/raw
|
||||
skip-decompress: true
|
||||
|
||||
- name: Verify downloaded file has .zip extension appended
|
||||
shell: bash
|
||||
run: |
|
||||
expected="ext-test/raw/report.txt-${{ matrix.runs-on }}.json.zip"
|
||||
if [ -f "$expected" ]; then
|
||||
echo "PASS: Downloaded file has .zip appended: $expected"
|
||||
else
|
||||
echo "FAIL: Expected $expected but got:"
|
||||
ls -al ext-test/raw/
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user