Skip to content

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

Merged
Szotkowski merged 7 commits intodevfrom
fix/alert-autofix-1
Feb 4, 2026
Merged

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#8
Szotkowski merged 7 commits intodevfrom
fix/alert-autofix-1

Conversation

@Szotkowski
Copy link
Copy Markdown
Member

Potential fix for https://github.com/Selecro/.github/security/code-scanning/1

In general, fix this by adding an explicit permissions: block to the workflow (or to the specific job) that grants only the minimal required scopes. For this branch-name check, no API access is needed: it just inspects environment variables. The safest, least-privilege configuration is to disable all default token permissions with permissions: {} at the job (or workflow) level.

Concretely, in .github/workflows/branch-name-check.yml, add a permissions: {} block under the check-branch-name job (indented to align with runs-on:). This tells GitHub Actions to provide a GITHUB_TOKEN with no permissions at all, which preserves existing behavior of the script while tightening security. No imports or additional methods are needed, since this is pure YAML configuration.

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

Szotkowski and others added 6 commits July 22, 2025 21:44
Signed-off-by: Michael Szotkowski <mikiszotkowski@protonmail.com>
Signed-off-by: Michael Szotkowski <mikiszotkowski@protonmail.com>
# Pull Request

## Description

Please describe what this PR does and why.

## Related Issues

Closes #<issue-number>

## Checklist

- [ ] Tests added
- [ ] Docs updated
- [ ] Follows contribution guidelines

Thank you for contributing to **Selecro**! 🧶

---------

Signed-off-by: Michael Szotkowski <mikiszotkowski@protonmail.com>
# Pull Request

## Description

Please describe what this PR does and why.

## Related Issues

Closes #<issue-number>

## Checklist

- [ ] Tests added
- [ ] Docs updated
- [ ] Follows contribution guidelines

Thank you for contributing to **Selecro**! 🧶

---------

Signed-off-by: Michael Szotkowski <mikiszotkowski@protonmail.com>
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Michael Szotkowski <mikiszotkowski@protonmail.com>
@Szotkowski Szotkowski changed the base branch from main to dev February 4, 2026 14:30
@Szotkowski Szotkowski marked this pull request as ready for review February 4, 2026 14:30
Signed-off-by: Michael Szotkowski <mikiszotkowski@protonmail.com>
@Szotkowski Szotkowski merged commit 6aa9d0d into dev Feb 4, 2026
2 checks passed
@Szotkowski Szotkowski deleted the fix/alert-autofix-1 branch February 4, 2026 14:31
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