From 6c0aeac7aa896c6993b5ea1fdba4527d0e7e8562 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Mon, 17 Aug 2026 12:03:49 -0700 Subject: [PATCH] Add explicit GITHUB_TOKEN permissions to workflow callers Resolves the three open `actions/missing-workflow-permissions` CodeQL alerts (#1, #3, #4). Each is a single-job caller of a reusable workflow in rubyatscale/shared-config, so the permissions block goes job-level, right above `uses:`, matching the query_packwerk precedent. A caller's block is the ceiling for the called workflow, so each grant covers exactly what the callee does and nothing more. - cd.yml -> contents: write. shared-config's cd.yml checks out with persisted credentials and runs discourse/publish-rubygems-action, which does `rake release` (a raw git push of the version tag), then `gh release create`. Anything less breaks the gem release. - 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. The implicit read of repo contents still works without naming contents. - triage.yml -> issues: write. shared-config's triage.yml only runs `gh issue edit --add-label triage`. ci.yml already declares workflow-level `contents: read` and codeql.yml already declares its own block, so both are left untouched. --- .github/workflows/cd.yml | 2 ++ .github/workflows/stale.yml | 3 +++ .github/workflows/triage.yml | 2 ++ 3 files changed, 7 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/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