From 2cc8414e9de274f5ceec39ec35a4234a569055a4 Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Fri, 25 Aug 2023 12:53:18 +0200 Subject: [PATCH] Move reviewdog-suggester permissions block to before the job definition The reviewdog-suggester job was failing to leave comments, reporting: ``` reviewdog: This GitHub token doesn't have write permission of Review API [1], so reviewdog will report results via logging command [2] and create annotations similar to github-pr-check reporter as a fallback. ``` Despite a `permissions` block the log showed the permissions as: ``` GITHUB_TOKEN Permissions Contents: read Issues: read Metadata: read PullRequests: read ``` Move the `permissions` block to earlier in the file, in case the position is important. --- .github/workflows/ktlint.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ktlint.yml b/.github/workflows/ktlint.yml index c7c0e4241..7fe43d9c8 100644 --- a/.github/workflows/ktlint.yml +++ b/.github/workflows/ktlint.yml @@ -1,5 +1,11 @@ name: reviewdog-suggester on: pull_request + +permissions: + contents: read + issues: write + pull-requests: write + jobs: ktlint: timeout-minutes: 5 @@ -29,7 +35,4 @@ jobs: with: tool_name: ktlintFormat -permissions: - contents: read - issues: write - pull-requests: write +