From c72373b8be62c4d14f9fa573ba49ca48b61a7c4d Mon Sep 17 00:00:00 2001 From: Whisperity Date: Sat, 21 Dec 2024 15:07:27 +0100 Subject: [PATCH] ci: Fix `pr-code-format` permissions for private forks The action requires the ability to change the contents of a pull request (by adding the formatting-related comment) which is only possible through the `write` permission, but if this permission is missing, potential private forks with Actions enabled will break, and because the action triggers on `pull_request_target` even a PR initially fixing this issue downstream will not exhibit the fix until merged. --- .github/workflows/pr-code-format.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr-code-format.yml b/.github/workflows/pr-code-format.yml index f2bb37316d3a8..fda5b6d96e78c 100644 --- a/.github/workflows/pr-code-format.yml +++ b/.github/workflows/pr-code-format.yml @@ -2,6 +2,8 @@ name: "Check code formatting" permissions: contents: read + issues: write + pull-requests: write on: pull_request: