mirror of
https://code.forgejo.org/forgejo/download-artifact.git
synced 2025-05-16 12:27:47 +02:00
Add support for tilde expansion (#50)
* Add support for tilde expansion * Print resolved path with debug * Update README * README * Only replace tilde in certain scenarios * Fix
This commit is contained in:
parent
83fcc74d04
commit
381af06b42
4 changed files with 49 additions and 11 deletions
18
.github/workflows/test.yml
vendored
18
.github/workflows/test.yml
vendored
|
@ -68,16 +68,24 @@ jobs:
|
|||
name: 'Artifact-A'
|
||||
path: some/new/path
|
||||
|
||||
# Test downloading an artifact using tilde expansion
|
||||
- name: Download artifact A
|
||||
uses: ./
|
||||
with:
|
||||
name: 'Artifact-A'
|
||||
path: ~/some/path/with/a/tilde
|
||||
|
||||
- name: Verify successful download
|
||||
run: |
|
||||
$file = "some/new/path/file-A.txt"
|
||||
if(!(Test-Path -path $file))
|
||||
$file1 = "some/new/path/file-A.txt"
|
||||
$file2 = "~/some/path/with/a/tilde/file-A.txt"
|
||||
if(!(Test-Path -path $file1) -or !(Test-Path -path $file2))
|
||||
{
|
||||
Write-Error "Expected file does not exist"
|
||||
Write-Error "Expected files do not exist"
|
||||
}
|
||||
if(!((Get-Content $file) -ceq "Lorem ipsum dolor sit amet"))
|
||||
if(!((Get-Content $file1) -ceq "Lorem ipsum dolor sit amet") -or !((Get-Content $file2) -ceq "Lorem ipsum dolor sit amet"))
|
||||
{
|
||||
Write-Error "File contents of downloaded artifact are incorrect"
|
||||
Write-Error "File contents of downloaded artifacts are incorrect"
|
||||
}
|
||||
shell: pwsh
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue