From f4381bb37348b1032b22ac75445bcec1dcf9e245 Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Tue, 2 Nov 2021 20:17:53 +0000 Subject: [PATCH] fix: Don't crash when unable to post comment to PR (#5669) ... by not ever posting such comments from this workflow. There will be a separate PR for the other workflow that does post comments, because it needs to be in the master branch. Part of #5659. --- .github/workflows/check_clang_format.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/check_clang_format.yml b/.github/workflows/check_clang_format.yml index 2691e7221..931688473 100644 --- a/.github/workflows/check_clang_format.yml +++ b/.github/workflows/check_clang_format.yml @@ -1,5 +1,7 @@ name: Check clang format +# N.B.: Runs with a read-only repo token. Safe(ish) to check out the +# submitted branch. on: [pull_request] jobs: @@ -15,14 +17,7 @@ jobs: clangFormatVersion: 12 style: Google - - uses: actions/github-script@v5 - if: failure() - with: - script: | - console.log(context.issue.number) - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: 'It looks like some of your files have not been formatted properly. Please run `npm run format`.' - }) + # The Report clang format workflow (report_clang_format.yml) will + # run (if required) after this one to post a comment to the PR. + # (Note that the version of that workflow run will be the one on + # the master (default) branch, not the PR target branch.)