Skip to content

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#127

Merged
dedece35 merged 1 commit intomainfrom
alert-autofix-2
Feb 13, 2026
Merged

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

Conversation

@dedece35
Copy link
Copy Markdown
Member

Potential fix for https://github.com/green-code-initiative/creedengo-python/security/code-scanning/2

In general, the fix is to define an explicit permissions block for the workflow or for the specific job so that the GITHUB_TOKEN has only the minimal scopes required. For a stale‑labeling workflow, that typically means read access to contents plus write access to pull requests (for labels and comments). We do not need broad contents: write or issues: write here, since the job only operates on pull requests.

For this specific file, the least intrusive, functionality‑preserving change is to add a permissions section under the stale job (indented to align with runs-on). We will set:

  • contents: read so the action can read repository data if needed.
  • pull-requests: write so it can label and comment on PRs.

We keep all existing keys and values unchanged. The new lines will go directly between runs-on: ubuntu-latest (line 9) and steps: (line 10) in .github/workflows/stale_tag.yml. No imports or additional definitions are required.

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>
@dedece35 dedece35 marked this pull request as ready for review February 13, 2026 20:38
@dedece35 dedece35 merged commit 9c3e45b into main Feb 13, 2026
9 checks passed
@dedece35 dedece35 deleted the alert-autofix-2 branch February 13, 2026 20:38
@sonarqubecloud
Copy link
Copy Markdown

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