git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] ci(check-whitespace): stop requiring a read/write token

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Jul 14, 2021, 22:09 UTC
Message-ID
<b54c137cb14527c14bd7c990f9cf32dca50ba5dc.1626300577.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.995.git.1626300577.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

As part of some recent security tightening, GitHub introduced the ability to configure GitHub workflows to be run with a read-only token. This is much more secure, in particular when working in a public repository: While the regular read/write token might be restricted to writing to the current branch, it is not necessarily restricted to access only the current Pull Request.

However, the `check-whitespace` workflow threw a wrench into this plan: it _requires_ write access (because it wants to add a PR comment in case of a whitespace issue).

Let's just skip that PR comment. The user can always click through to the actual error, even if it is slightly less convenient.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 .github/workflows/check-whitespace.yml | 16 ----------------
 1 file changed, 16 deletions(-)
diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml
index f1483059c76..c53614d6033 100644
--- a/.github/workflows/check-whitespace.yml
+++ b/.github/workflows/check-whitespace.yml
@@ -51,21 +51,5 @@ jobs:
 
         if test -n "${log}"
         then
-          echo "::set-output name=checkout::"${log}""
           exit 2
         fi
-
-    - name: Add Check Output as Comment
-      uses: actions/github-script@v3
-      id: add-comment
-      env:
-        log: ${{ steps.check_out.outputs.checkout }}
-      with:
-        script: |
-            await github.issues.createComment({
-              issue_number: context.issue.number,
-              owner: context.repo.owner,
-              repo: context.repo.repo,
-              body: `Whitespace errors found in workflow ${{ github.workflow }}:\n\n\`\`\`\n${process.env.log.replace(/\\n/g, "\n")}\n\`\`\``
-            })
-      if: ${{ failure() }}
-- 
gitgitgadget
Previous: Johannes Schindelin via GitGitGadgetNext: Junio C Hamano
Message 2 of 8 in “check-whitespace: two fixes”
  1. 0/2 check-whitespace: two fixesJohannes Schindelin via GitGitGadget, Jul 14, 2021
  2. 1/2 ci(check-whitespace): stop requiring a read/write tokenJohannes Schindelin via GitGitGadget, Jul 14, 2021
  3. Junio C HamanoJul 14, 2021
  4. 2/2 ci(check-whitespace): restrict to the intended commitsJohannes Schindelin via GitGitGadget, Jul 14, 2021
  5. Junio C HamanoJul 14, 2021
  6. Taylor BlauJul 14, 2021
  7. Johannes SchindelinJul 15, 2021
  8. Johannes SchindelinJul 15, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.