Skip to content

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

Merged
coldhighsun merged 1 commit into
mainfrom
alert-autofix-2
Oct 15, 2026
Merged

coldhighsun merged 1 commit into
mainfrom
alert-autofix-2

Conversation

@coldhighsun

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/coldhighsun/AIUsageMonitor/security/code-scanning/2

Add an explicit permissions block to the publish-nuget job in .github/workflows/ci.yml, using least privilege. For this job, contents: read is the appropriate minimal permission because it checks out source and builds/packs, but does not need to write to repository contents, issues, PRs, or releases.

Best single fix without changing functionality:

  • Edit .github/workflows/ci.yml
  • In the publish-nuget job (right after runs-on), insert:
    • permissions:
    • contents: read

No imports, methods, or extra definitions are needed (YAML workflow only).

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>
@coldhighsun
coldhighsun marked this pull request as ready for review October 15, 2026 01:53
@coldhighsun
coldhighsun merged commit 3d54b90 into main Oct 15, 2026
3 checks passed
@coldhighsun
coldhighsun deleted the alert-autofix-2 branch October 15, 2026 01:54
@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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