Skip to content

Commit 3d6f605

Browse files
authored
Merge pull request #2163 from SEKOIA-IO/gha/fix-upload
ci: Move away from `upload-artifact@v3`
2 parents 7cd79a5 + d091421 commit 3d6f605

File tree

4 files changed

+10
-40
lines changed

4 files changed

+10
-40
lines changed

.github/workflows/delete-preview.yaml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,11 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- name: Download artifact
16-
uses: actions/[email protected]
15+
- uses: actions/download-artifact@v4
1716
with:
18-
script: |
19-
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
20-
owner: context.repo.owner,
21-
repo: context.repo.repo,
22-
run_id: ${{github.event.workflow_run.id }},
23-
});
24-
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
25-
return artifact.name == "PR"
26-
})[0];
27-
var download = await github.rest.actions.downloadArtifact({
28-
owner: context.repo.owner,
29-
repo: context.repo.repo,
30-
artifact_id: matchArtifact.id,
31-
archive_format: 'zip',
32-
});
33-
var fs = require('fs');
34-
fs.writeFileSync('${{github.workspace}}/PR.zip', Buffer.from(download.data));
17+
name: PR
18+
github-token: ${{ github.token }}
19+
run-id: ${{ github.event.workflow_run.id }}
3520

3621
- run: unzip PR.zip
3722

.github/workflows/preview-cleanup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
mkdir PR
1414
echo ${{ github.event.number }} > ./PR/PR_NUMBER
1515
16-
- uses: actions/upload-artifact@v3
16+
- uses: actions/upload-artifact@v4
1717
with:
1818
name: PR
1919
path: PR/

.github/workflows/preview.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- run: |
5656
tar zcvf site.tar.gz -C site .
5757
58-
- uses: actions/upload-artifact@v3
58+
- uses: actions/upload-artifact@v4
5959
with:
6060
name: site.tar.gz
6161
path: site.tar.gz

.github/workflows/upload-preview.yaml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,11 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- name: Download artifact
16-
uses: actions/[email protected]
15+
- uses: actions/download-artifact@v4
1716
with:
18-
script: |
19-
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
20-
owner: context.repo.owner,
21-
repo: context.repo.repo,
22-
run_id: ${{github.event.workflow_run.id }},
23-
});
24-
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
25-
return artifact.name == "site.tar.gz"
26-
})[0];
27-
var download = await github.rest.actions.downloadArtifact({
28-
owner: context.repo.owner,
29-
repo: context.repo.repo,
30-
artifact_id: matchArtifact.id,
31-
archive_format: 'zip',
32-
});
33-
var fs = require('fs');
34-
fs.writeFileSync('${{github.workspace}}/site.tar.gz.zip', Buffer.from(download.data));
17+
name: site.tar.gz
18+
github-token: ${{ github.token }}
19+
run-id: ${{ github.event.workflow_run.id }}
3520

3621
- run: |
3722
unzip site.tar.gz.zip

0 commit comments

Comments
 (0)