From 68b20d8a01d8d05e75fcac290923aacc946aac3b Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Wed, 1 May 2024 16:57:36 -0400 Subject: [PATCH] fix: use `github.rest.actions.cancelWorkflowRun` instead of `github.actions.cancelWorkflowRun` (#36499) This is breaking change per `actions/github-script` v5 update see https://github.com/actions/github-script?tab=readme-ov-file#v5 Signed-off-by: Rui Chen --- .github/workflows/pr-auto-fix.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-auto-fix.yaml b/.github/workflows/pr-auto-fix.yaml index 13511d3c86c..7566c2776aa 100644 --- a/.github/workflows/pr-auto-fix.yaml +++ b/.github/workflows/pr-auto-fix.yaml @@ -29,7 +29,7 @@ jobs: path: ~/.cache/bazel # formattedTime here is like 2021323 - the year concatenated with the week then # the day of that week. - # As this changes every day, we cycle to a new cache once per day, with lookup + # As this changes every day, we cycle to a new cache once per day, with lookup # across the week (and then the year). key: ${{ runner.os }}-${{ steps.current-time-with-day.outputs.formattedTime }} restore-keys: | @@ -48,13 +48,13 @@ jobs: with: script: | // If you'd like not to run this code on your commits, add your github user id here: - NO_AUTOFIX_USERS = ["copybara-service[bot]"] - const { owner, repo } = context.repo + const NO_AUTOFIX_USERS = ["copybara-service[bot]"]; + const { owner, repo } = context.repo; console.log("Actor: " + context.actor); if (NO_AUTOFIX_USERS.includes(context.actor)) { console.log('Cancelling'); const run_id = "${{ github.run_id }}"; - await github.actions.cancelWorkflowRun({ owner, repo, run_id }); + await github.rest.actions.cancelWorkflowRun({ owner, repo, run_id }); return 'go'; } else { return 'stay';