Skip to content

Commit 61dc233

Browse files
HumairAKopenshift-merge-bot[bot]
authored andcommitted
update upload-artifact in gh ci
Signed-off-by: Humair Khan <[email protected]>
1 parent 7f7f785 commit 61dc233

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

.github/workflows/build-prs-trigger.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
echo ${{ github.event.pull_request.state }} >> ./pr/pr_state
3030
echo ${{ github.event.pull_request.head.sha }} >> ./pr/head_sha
3131
echo ${{ github.event.action }} >> ./pr/event_action
32-
- uses: actions/upload-artifact@v3
32+
- uses: actions/upload-artifact@v4
3333
with:
3434
name: pr
3535
path: pr/

.github/workflows/build-prs.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,24 @@ jobs:
2525
event_action: ${{ steps.vars.outputs.event_action }}
2626
steps:
2727
- name: 'Download artifact'
28-
uses: actions/github-script@v3.1.0
28+
uses: actions/github-script@v6
2929
with:
3030
script: |
31-
var artifacts = await github.actions.listWorkflowRunArtifacts({
32-
owner: context.repo.owner,
33-
repo: context.repo.repo,
34-
run_id: ${{github.event.workflow_run.id }},
31+
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
32+
owner: context.repo.owner,
33+
repo: context.repo.repo,
34+
run_id: ${{github.event.workflow_run.id}},
3535
});
36-
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
37-
return artifact.name == "pr"
36+
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
37+
return artifact.name == "pr"
3838
})[0];
39-
var download = await github.actions.downloadArtifact({
40-
owner: context.repo.owner,
41-
repo: context.repo.repo,
42-
artifact_id: matchArtifact.id,
43-
archive_format: 'zip',
39+
let download = await github.rest.actions.downloadArtifact({
40+
owner: context.repo.owner,
41+
repo: context.repo.repo,
42+
artifact_id: matchArtifact.id,
43+
archive_format: 'zip',
4444
});
45-
var fs = require('fs');
45+
let fs = require('fs');
4646
fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data));
4747
- run: unzip pr.zip
4848
- shell: bash

.github/workflows/release_create.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,21 @@ jobs:
2929
uses: actions/[email protected]
3030
with:
3131
script: |
32-
var artifacts = await github.actions.listWorkflowRunArtifacts({
33-
owner: context.repo.owner,
34-
repo: context.repo.repo,
35-
run_id: ${{github.event.workflow_run.id }},
32+
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
33+
owner: context.repo.owner,
34+
repo: context.repo.repo,
35+
run_id: ${{github.event.workflow_run.id}},
3636
});
37-
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
38-
return artifact.name == "pr"
37+
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
38+
return artifact.name == "pr"
3939
})[0];
40-
var download = await github.actions.downloadArtifact({
41-
owner: context.repo.owner,
42-
repo: context.repo.repo,
43-
artifact_id: matchArtifact.id,
44-
archive_format: 'zip',
40+
let download = await github.rest.actions.downloadArtifact({
41+
owner: context.repo.owner,
42+
repo: context.repo.repo,
43+
artifact_id: matchArtifact.id,
44+
archive_format: 'zip',
4545
});
46-
var fs = require('fs');
46+
let fs = require('fs');
4747
fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data));
4848
- run: unzip pr.zip
4949
- shell: bash

.github/workflows/release_trigger.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
PR_STATE: ${{ github.event.pull_request.state }}
2323
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
2424
run: ./.github/scripts/release_trigger/upload-data.sh
25-
- uses: actions/upload-artifact@v3
25+
- uses: actions/upload-artifact@v4
2626
with:
2727
name: pr
2828
path: pr/

0 commit comments

Comments
 (0)