Skip to content

Commit 49552fc

Browse files
committed
add overwrite tests to workflow
1 parent 7961590 commit 49552fc

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/test.yml

+28
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,31 @@ jobs:
140140
Write-Error "File contents of downloaded artifacts are incorrect"
141141
}
142142
shell: pwsh
143+
144+
# Replace the contents of Artifact #1
145+
- name: 'Overwrite artifact #1 again'
146+
uses: ./
147+
with:
148+
name: 'Artifact-A-${{ matrix.runs-on }}'
149+
path: path/to/dir-2/file2.txt
150+
overwrite: true
151+
152+
# Download replaced Artifact #1 and verify the correctness of the content
153+
- name: 'Download artifact #1 again'
154+
uses: actions/download-artifact@v4
155+
with:
156+
name: 'Artifact-A-${{ matrix.runs-on }}'
157+
path: overwrite/some/new/path
158+
159+
- name: 'Verify Artifact #1 again'
160+
run: |
161+
$file = "overwrite/some/new/path/file2.txt"
162+
if(!(Test-Path -path $file))
163+
{
164+
Write-Error "Expected file does not exist"
165+
}
166+
if(!((Get-Content $file) -ceq "Hello world from file #2"))
167+
{
168+
Write-Error "File contents of downloaded artifacts are incorrect"
169+
}
170+
shell: pwsh

0 commit comments

Comments
 (0)