Add support for tilde expansion

This commit is contained in:
Konrad Pabjan 2020-07-29 13:25:47 +02:00
parent 83fcc74d04
commit 0d118dea33
3 changed files with 28 additions and 11 deletions

View file

@ -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