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:
Konrad Pabjan 2020-07-30 12:01:38 +02:00 committed by GitHub
parent 83fcc74d04
commit 381af06b42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 49 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