From b0202f71ebcf723f6756746c7848b53b4fe3ef41 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Wed, 9 Feb 2022 01:09:36 +0300 Subject: [PATCH] Update `actions/github-script` to v5 (#7151) --- .github/workflows/mypy_primer_comment.yml | 10 +++++----- .github/workflows/stubtest.yml | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/mypy_primer_comment.yml b/.github/workflows/mypy_primer_comment.yml index ae9c7dcd4..150099130 100644 --- a/.github/workflows/mypy_primer_comment.yml +++ b/.github/workflows/mypy_primer_comment.yml @@ -17,11 +17,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Download diffs - uses: actions/github-script@v3 + uses: actions/github-script@v5 with: script: | const fs = require('fs'); - const artifacts = await github.actions.listWorkflowRunArtifacts({ + const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ owner: context.repo.owner, repo: context.repo.repo, run_id: ${{ github.event.workflow_run.id }}, @@ -29,7 +29,7 @@ jobs: const [matchArtifact] = artifacts.data.artifacts.filter((artifact) => artifact.name == "mypy_primer_diffs"); - const download = await github.actions.downloadArtifact({ + const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, artifact_id: matchArtifact.id, @@ -44,7 +44,7 @@ jobs: - name: Post comment id: post-comment - uses: actions/github-script@v3 + uses: actions/github-script@v5 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | @@ -59,7 +59,7 @@ jobs: } const prNumber = parseInt(fs.readFileSync("pr_number.txt", { encoding: "utf8" })) - await github.issues.createComment({ + await github.rest.issues.createComment({ issue_number: prNumber, owner: context.repo.owner, repo: context.repo.repo, diff --git a/.github/workflows/stubtest.yml b/.github/workflows/stubtest.yml index 9429773fa..714039c24 100644 --- a/.github/workflows/stubtest.yml +++ b/.github/workflows/stubtest.yml @@ -68,11 +68,11 @@ jobs: permissions: issues: write steps: - - uses: actions/github-script@v3 + - uses: actions/github-script@v5 with: - github-token: ${{secrets.GITHUB_TOKEN}} + github-token: ${{ secrets.GITHUB_TOKEN }} script: | - await github.issues.create({ + await github.rest.issues.create({ owner: "python", repo: "typeshed", title: `Stubtest failed on ${new Date().toDateString()}`,