diff --git a/.github/workflows/build-prs-trigger.yaml b/.github/workflows/build-prs-trigger.yaml index f620062c1..ddea2b16c 100644 --- a/.github/workflows/build-prs-trigger.yaml +++ b/.github/workflows/build-prs-trigger.yaml @@ -29,7 +29,7 @@ jobs: echo ${{ github.event.pull_request.state }} >> ./pr/pr_state echo ${{ github.event.pull_request.head.sha }} >> ./pr/head_sha echo ${{ github.event.action }} >> ./pr/event_action - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: pr path: pr/ diff --git a/.github/workflows/build-prs.yml b/.github/workflows/build-prs.yml index d6d46be9b..dd40b646f 100644 --- a/.github/workflows/build-prs.yml +++ b/.github/workflows/build-prs.yml @@ -25,24 +25,24 @@ jobs: event_action: ${{ steps.vars.outputs.event_action }} steps: - name: 'Download artifact' - uses: actions/github-script@v3.1.0 + uses: actions/github-script@v6 with: script: | - var artifacts = await github.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, + let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: ${{github.event.workflow_run.id}}, }); - var matchArtifact = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "pr" + let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { + return artifact.name == "pr" })[0]; - var download = await github.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', + let download = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: 'zip', }); - var fs = require('fs'); + let fs = require('fs'); fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data)); - run: unzip pr.zip - shell: bash diff --git a/.github/workflows/release_create.yaml b/.github/workflows/release_create.yaml index 73cc2e21e..840826bac 100644 --- a/.github/workflows/release_create.yaml +++ b/.github/workflows/release_create.yaml @@ -29,21 +29,21 @@ jobs: uses: actions/github-script@v3.1.0 with: script: | - var artifacts = await github.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, + let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: ${{github.event.workflow_run.id}}, }); - var matchArtifact = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "pr" + let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { + return artifact.name == "pr" })[0]; - var download = await github.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', + let download = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: 'zip', }); - var fs = require('fs'); + let fs = require('fs'); fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data)); - run: unzip pr.zip - shell: bash diff --git a/.github/workflows/release_trigger.yaml b/.github/workflows/release_trigger.yaml index 2e36f147f..37a4017c3 100644 --- a/.github/workflows/release_trigger.yaml +++ b/.github/workflows/release_trigger.yaml @@ -22,7 +22,7 @@ jobs: PR_STATE: ${{ github.event.pull_request.state }} PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} run: ./.github/scripts/release_trigger/upload-data.sh - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: pr path: pr/