Skip to content

Commit

Permalink
(chore) Upgrade size report comment workflow to github-script v6 (#3849)
Browse files Browse the repository at this point in the history
* Upgrade scripts to v6

* Use REST namespace for actions
  • Loading branch information
bradleymackey authored Aug 23, 2023
1 parent 30cb6c7 commit 7a522e9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/size_report_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ jobs:
github.event.workflow_run.conclusion == 'success'
steps:
- name: "Download size report artifact"
uses: actions/github-script@v3.1.0
uses: actions/github-script@v6
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
var artifacts = 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 == "size_report"
})[0];
var download = await github.actions.downloadArtifact({
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
Expand All @@ -37,14 +37,14 @@ jobs:
- run: unzip -d size_report size_report.zip

- name: "Comment on PR"
uses: actions/github-script@v3
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var fs = require('fs');
var issue_number = Number(fs.readFileSync('./size_report/pull_req_nr'));
var size_report = String(fs.readFileSync('./size_report/report.md'));
await github.issues.createComment({
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
Expand Down

0 comments on commit 7a522e9

Please sign in to comment.