Skip to content

ci: Add explicit read-only GITHUB_TOKEN permissions to workflows - #122

Open
khvn26 wants to merge 1 commit into
mainfrom
kimgustyr/eng-1230-flagsmith-flutter-client-add-eda7
Open

khvn26 wants to merge 1 commit into
mainfrom
kimgustyr/eng-1230-flagsmith-flutter-client-add-eda7

Conversation

@khvn26

@khvn26 khvn26 commented Dec 3, 2026

Copy link
Copy Markdown
Member

The org default GITHUB_TOKEN permission is being switched to read-only. This PR gives the publish and pull request workflows an explicit permissions: block, so they don't rely on the org default.

Changes

  • Workflows that analyse, test and dry-run publish request read-only repository access (contents: read). None of them writes to the repository.
  • The pub.dev publish job already declares its own id-token: write permission and is unchanged.

Review effort: 1/5

Generated with [Linear](https://linear.app/flagsmith/agent-session/33a82750-9799-4c74-a30e-5b1b7d45dea6)

Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
@khvn26
khvn26 marked this pull request as ready for review December 3, 2026 14:50
@khvn26
khvn26 requested a review from a team as a code owner December 3, 2026 14:50
@khvn26
khvn26 requested review from talissoncosta and removed request for a team December 3, 2026 14:50

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Confidence score: 2/5

  • In .github/workflows/publish.yml, the publish job’s permissions block prevents checkout from reading the tagged repository, so publishing will fail. Add contents: read to the job’s permissions.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/publish.yml">

<violation number="1" location=".github/workflows/publish.yml:8">
P1: The `publish` job's own `permissions` block overrides this workflow-level permission, so its checkout receives only `id-token: write` and cannot read the tagged repository. Add `contents: read` to the `publish` job's permissions as well.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

- "*"

permissions:
contents: read

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The publish job's own permissions block overrides this workflow-level permission, so its checkout receives only id-token: write and cannot read the tagged repository. Add contents: read to the publish job's permissions as well.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/workflows/publish.yml, line 8:

<comment>The `publish` job's own `permissions` block overrides this workflow-level permission, so its checkout receives only `id-token: write` and cannot read the tagged repository. Add `contents: read` to the `publish` job's permissions as well.</comment>

<file context>
@@ -4,6 +4,9 @@ on:
       - "*"
 
+permissions:
+  contents: read
+
 env:
</file context>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants