Skip to content

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#13

Merged
jbouder merged 1 commit intomainfrom
alert-autofix-1
Jul 30, 2025
Merged

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#13
jbouder merged 1 commit intomainfrom
alert-autofix-1

Conversation

@jbouder
Copy link
Contributor

@jbouder jbouder commented Jul 30, 2025

Potential fix for https://github.com/MetroStar/comet-api/security/code-scanning/1

To fix the problem, you should add a permissions block to the workflow to explicitly specify the minimal required permissions for the GITHUB_TOKEN. Since the workflow needs to push changes to the repository, it requires contents: write. The permissions block can be added at the top level of the workflow (applies to all jobs) or at the job level (applies only to the specific job). In this case, since there is only one job, adding it at the job level is sufficient and clear. You should add the following block under the update-docs: job definition (after runs-on: ubuntu-latest):

permissions:
  contents: write

No additional imports or definitions are needed.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@jbouder jbouder marked this pull request as ready for review July 30, 2025 20:32
@jbouder jbouder merged commit a13aa44 into main Jul 30, 2025
7 checks passed
@jbouder jbouder deleted the alert-autofix-1 branch July 30, 2025 20:32
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