Update actions/github-script to v5 (#7151)

This commit is contained in:
Nikita Sobolev
2022-02-09 01:09:36 +03:00
committed by GitHub
parent be5a109c03
commit b0202f71eb
2 changed files with 8 additions and 8 deletions

View File

@@ -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,

View File

@@ -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()}`,