From eeba5e72f7cd4bb8f3a1cc82e74f7ea2720c3c27 Mon Sep 17 00:00:00 2001 From: Samuel K Date: Thu, 15 Oct 2026 00:44:59 -0600 Subject: [PATCH] ci: default pr-ci token to contents read pr-ci.yml had no workflow-level permissions, so every job without its own block ran with the repository default GITHUB_TOKEN scope. The token is also passed to e2e tests as GH_ACCESS_TOKEN. - Add top-level permissions: contents: read. - Add job-level permissions to lint: pull-requests: read, because golangci-lint-action only-new-issues calls pulls.get on pull_request. - Existing changes and agent-skill blocks are unchanged. --- .github/workflows/pr-ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index de918b156..a5b0f0978 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -6,6 +6,10 @@ on: workflow_dispatch: pull_request: +# Default for every job; jobs needing more declare their own job-level permissions block. +permissions: + contents: read + concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.run_id }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} @@ -66,6 +70,10 @@ jobs: lint: name: Lint runs-on: ubuntu-latest + # golangci-lint only-new-issues fetches the PR diff via the pulls API on pull_request. + permissions: + contents: read + pull-requests: read steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7