Skip to content

Conversation

@nicolasbock
Copy link
Owner

Potential fix for https://github.com/nicolasbock/ebuildtester/security/code-scanning/5

To fix the issue, the workflow should include a permissions block specifying the least privileges required for each job. This can be done at the root level of the workflow (applicable to all jobs) or for individual jobs. In this case:

  • For the build job, the permissions should be restricted to contents: read because it only interacts with code repositories and uploads artifacts.
  • For the publish-to-pypi job, the permissions already specify the required id-token: write scope, but we can clarify other permissions explicitly (like contents: read).

Changes will be made to .github/workflows/publish.yaml to introduce these explicit permissions.


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>
@nicolasbock nicolasbock marked this pull request as ready for review July 10, 2025 18:54
@Copilot Copilot AI review requested due to automatic review settings July 10, 2025 18:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds explicit job-level permissions to comply with the security scanning alert by restricting each job’s privileges.

  • Adds permissions: contents: read to the build job.
  • Adds permissions: contents: read alongside id-token: write to the publish-to-pypi job.
Comments suppressed due to low confidence (2)

.github/workflows/publish.yaml:12

  • [nitpick] The contents: read permission is duplicated in multiple jobs. Consider defining a root-level permissions block to set default least-privilege access and override per-job as needed.
    permissions:

.github/workflows/publish.yaml:46

  • [nitpick] The job name 'pypi' is vague; consider renaming it to something more descriptive like 'Publish to PyPI'.
      name: pypi

@nicolasbock nicolasbock merged commit c283742 into main Jul 10, 2025
12 checks passed
@nicolasbock nicolasbock deleted the alert-autofix-5 branch July 10, 2025 18:58
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