Skip to content

Give the CI workflows a read-only GITHUB_TOKEN. - #10730

Closed
dpage wants to merge 1 commit into
pgadmin-org:masterfrom
dpage:ci-workflow-permissions
Closed

dpage wants to merge 1 commit into
pgadmin-org:masterfrom
dpage:ci-workflow-permissions

Conversation

@dpage

@dpage dpage commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

The repository's default workflow token permission is write, and twelve of the check and test workflows declare no permissions: of their own, so their jobs get a write token they never use. This adds a top-level permissions: contents: read to each, matching acceptance-test.yml and snapshot.yml, and clears the 12 CodeQL actions/missing-workflow-permissions alerts.

None of the affected jobs use the token beyond actions/checkout and actions/upload-artifact. I've checked that this merges cleanly with #10727 in either order, and its new check-epas-secrets job is fine with read-only permissions.

Summary by CodeRabbit

  • Chores
    • Automated build, style, translation, and test workflows now have read-only access to repository contents.
    • No user-facing changes.

The repository's default workflow token permission is write, and these
twelve workflows set no permissions of their own, so every job was handed
a token able to write to the repository. None of them use it for anything
beyond checking out the code and uploading artefacts, so restrict the
token to contents: read, matching the workflows that already declare it.
This clears the CodeQL actions/missing-workflow-permissions alerts.
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Twelve GitHub Actions workflows now declare contents: read permissions. The changes cover documentation, style, build, translation, and test workflows.

Changes

CI workflow permissions

Layer / File(s) Summary
Declare read-only contents access
.github/workflows/check-doc-builds.yml, .github/workflows/check-javascript-style.yml, .github/workflows/check-python-build.yml, .github/workflows/check-python-style.yml, .github/workflows/check-tarball-build.yml, .github/workflows/check-translations.yml, .github/workflows/run-feature-tests-epas.yml, .github/workflows/run-feature-tests-pg.yml, .github/workflows/run-javascript-tests.yml, .github/workflows/run-python-tests-epas.yml, .github/workflows/run-python-tests-pg.yml, .github/workflows/run-python-tests-server-mode.yml
Each workflow now declares contents: read permissions.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Possibly related PRs

  • pgadmin-org/pgadmin4#10727: It changes some of the same CI workflows, so the permissions added here also apply to jobs changed or added by that PR.

Suggested reviewers: asheshv

Merge Risk: Minimal · up to 8c040

The workflows retain the required checkout and artifact behavior while removing unnecessary token permissions.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Give the CI workflows a read-only GITHUB_TOKEN." matches the main change. The raw summary shows that all twelve workflow files gain a three-line top-level permissions block that limits the …
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Give the CI workflows a read-only GITHUB_TOKEN." matches the main change. The raw summary shows that all twelve workflow files gain a three-line top-level permissions block that limits the token to contents: read. The PR objectives state the same purpose: the twelve workflows do not need write access, and the change limits their tokens accordingly. The title is specific and concise, and it does not mention any file list or vague wording.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (12 skipped: 12 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between dde24b4 and 8c04072.

Files selected for processing: 12
  • .github/workflows/check-doc-builds.yml
  • .github/workflows/check-javascript-style.yml
  • .github/workflows/check-python-build.yml
  • .github/workflows/check-python-style.yml
  • .github/workflows/check-tarball-build.yml
  • .github/workflows/check-translations.yml
  • .github/workflows/run-feature-tests-epas.yml
  • .github/workflows/run-feature-tests-pg.yml
  • .github/workflows/run-javascript-tests.yml
  • .github/workflows/run-python-tests-epas.yml
  • .github/workflows/run-python-tests-pg.yml
  • .github/workflows/run-python-tests-server-mode.yml

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@dpage

dpage commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged as ea1a1db.

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.

1 participant