Skip to content

Restrict submit-repos workflow token permissions - #27

Merged
antgrutta merged 3 commits into
mainfrom
copilot/fix-code-scanning-alert-2
May 13, 2026
Merged

Restrict submit-repos workflow token permissions#27
antgrutta merged 3 commits into
mainfrom
copilot/fix-code-scanning-alert-2

Conversation

Copilot AI commented May 13, 2026

Copy link
Copy Markdown
Contributor

Bug Fix

Code scanning alert #2 flagged .github/workflows/submit-repos.yml for missing explicit workflow permissions. This change removes reliance on repository-default GITHUB_TOKEN scopes and documents the workflow’s least-privilege access.

  • What was the bug?

    • submit-repos.yml had no permissions block.
    • The workflow therefore inherited default token permissions, which may be broader than required.
  • How did you fix it?

    • Added a root-level permissions block with contents: read.
    • Kept workflow behavior unchanged; repository-modifying API calls still use the GitHub App token created in the job.
  • Example

    permissions:
      contents: read

Copilot AI changed the title [WIP] Fix code scanning alert(s) flagged in this repository Restrict submit-repos workflow token permissions May 13, 2026
Copilot AI requested a review from antgrutta May 13, 2026 16:11
@antgrutta
antgrutta marked this pull request as ready for review May 13, 2026 16:19
@antgrutta
antgrutta requested a review from ssulei7 as a code owner May 13, 2026 16:19
Copilot AI review requested due to automatic review settings May 13, 2026 16:19

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

Adds an explicit least-privilege permissions block to the submit-repos.yml workflow to address a code scanning alert flagging missing workflow token permissions. Repository-modifying operations continue to use a separate GitHub App token created within the job, so behavior is unchanged.

Changes:

  • Added root-level permissions: contents: read to .github/workflows/submit-repos.yml.
Show a summary per file
File Description
.github/workflows/submit-repos.yml Declares minimal contents: read token scope for the workflow.

Copilot's findings

Tip

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

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@antgrutta antgrutta left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, we're using the GH App to do the issue submit any way.

@antgrutta
antgrutta merged commit ccb867b into main May 13, 2026
8 checks passed
@antgrutta
antgrutta deleted the copilot/fix-code-scanning-alert-2 branch May 13, 2026 16:23
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