From 178ec123e330d6277f79ec81f5058b05ab5aaa26 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Mon, 17 Aug 2026 12:04:52 -0700 Subject: [PATCH] Add explicit GITHUB_TOKEN permissions to workflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves the six open `actions/missing-workflow-permissions` CodeQL alerts (#1, #2, #4, #5, #6, #7) by giving every job an explicit, least-privilege permissions block. - ci.yml: one workflow-level `contents: read`. All three jobs (rspec, static_type_check, notify_on_failure) only check out the repo and run rspec / srb tc; the Slack notifier posts to an incoming webhook and needs no GitHub API scope at all, so read is the floor that covers the file. - cd.yml: `contents: write` on the caller job. shared-config's cd.yml runs discourse/publish-rubygems-action, which does a raw `git push` of the release tag, and then `gh release create` — both need write. Caller permissions are the ceiling for a reusable workflow, so anything less would break releases. - stale.yml: `issues: write` + `pull-requests: write`. shared-config's stale.yml runs actions/stale, which comments on and closes both stale issues and stale PRs. - triage.yml: `issues: write`. shared-config's triage.yml runs `gh issue edit --add-label triage` (its own job already declares `issues: write`; the caller must grant at least that). codeql.yml already declares its permissions and is untouched. --- .github/workflows/cd.yml | 2 ++ .github/workflows/ci.yml | 3 +++ .github/workflows/stale.yml | 3 +++ .github/workflows/triage.yml | 2 ++ 4 files changed, 10 insertions(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8cb675f..4c9ab97 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -8,5 +8,7 @@ on: jobs: call-workflow-from-shared-config: + permissions: + contents: write uses: rubyatscale/shared-config/.github/workflows/cd.yml@main secrets: inherit diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abb33ba..3b76b39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ on: - main pull_request: +permissions: + contents: read + jobs: rspec: runs-on: ubuntu-latest diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 0287d52..2696450 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -5,4 +5,7 @@ on: - cron: '0 0 * * *' jobs: call-workflow-from-shared-config: + permissions: + issues: write + pull-requests: write uses: rubyatscale/shared-config/.github/workflows/stale.yml@main diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index 74bb1d9..7c492ee 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -6,4 +6,6 @@ on: - opened jobs: call-workflow-from-shared-config: + permissions: + issues: write uses: rubyatscale/shared-config/.github/workflows/triage.yml@main