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 <rui@chenrui.dev>
pull/36511/head
Rui Chen 7 months ago committed by GitHub
parent 1e5fc3df8b
commit 68b20d8a01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      .github/workflows/pr-auto-fix.yaml

@ -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';

Loading…
Cancel
Save