Skip to content

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

Merged
mabdullahsoyturk merged 1 commit into
masterfrom
alert-autofix-1
Aug 22, 2026
Merged

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#19
mabdullahsoyturk merged 1 commit into
masterfrom
alert-autofix-1

Conversation

@mabdullahsoyturk

Copy link
Copy Markdown
Collaborator

Potential fix for https://github.com/GAMS-dev/gamspy-examples/security/code-scanning/1

Add an explicit permissions block to the workflow so GITHUB_TOKEN is scoped minimally and predictably.
Best fix: set workflow-level permissions to contents: read because this workflow only checks out code and runs tests, and no step indicates write operations to issues/PRs/packages. This preserves current functionality while enforcing least privilege.

Edit .github/workflows/tests.yml near the top-level keys (after on: and before jobs:) to include:

  • permissions:
  • contents: read

No imports, methods, or external 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>
@mabdullahsoyturk
mabdullahsoyturk marked this pull request as ready for review August 22, 2026 13:25
@mabdullahsoyturk
mabdullahsoyturk merged commit ec61c8f into master Aug 22, 2026
3 of 5 checks passed
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