Skip to content

Reduce PR dashboard workflow token permissions#22

Merged
maryliag merged 1 commit into
open-telemetry:mainfrom
trask:trask/pr-dashboard-token-permissions
Jun 26, 2026
Merged

Reduce PR dashboard workflow token permissions#22
maryliag merged 1 commit into
open-telemetry:mainfrom
trask:trask/pr-dashboard-token-permissions

Conversation

@trask

@trask trask commented Jun 26, 2026

Copy link
Copy Markdown
Member

Remove unused job-level GITHUB_TOKEN scopes from the pull request dashboard workflows. Target repository API access continues to use the repository-scoped GitHub App installation tokens, while the job token keeps only the contents access needed for checkout and state-branch pushes.

@trask trask marked this pull request as ready for review June 26, 2026 20:29
@trask trask requested a review from a team as a code owner June 26, 2026 20:29
Copilot AI review requested due to automatic review settings June 26, 2026 20:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens least-privilege on the two pull request dashboard workflows by removing job-level GITHUB_TOKEN scopes that the jobs don't actually exercise. I verified the change is safe: every GitHub API call in the dashboard scripts runs through the GitHub App installation token (GH_TOKEN/PR_DASHBOARD_TOKEN created by create-github-app-token, which is explicitly scoped per job), while the job GITHUB_TOKEN is only used for actions/checkout and the state-branch git push in state_branch.push_state — both covered by the retained contents scope. The reusable-workflow caller run-repo-dashboard now grants only contents: write, which matches the permissions every called job declares.

Changes:

  • Removed unused actions: read, checks: read, issues: write/read, and pull-requests: read job scopes across the dashboard jobs.
  • Kept contents (read/write) where checkout and state-branch pushes require it.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/pull-request-dashboard.yml Trims the run-repo-dashboard caller job to only contents: write, matching the scopes the reusable workflow's jobs need.
.github/workflows/pull-request-dashboard-repo.yml Removes unused issues/pull-requests/checks/actions scopes from the post-review-guidance, update-dashboard, notify-slack, and publish-dashboard jobs, relying on the app token for API access.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@maryliag maryliag merged commit ced07bf into open-telemetry:main Jun 26, 2026
5 checks passed
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.

3 participants