Skip to content

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

Merged
ticpu merged 1 commit into
masterfrom
workflow-permission
Aug 7, 2026
Merged

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#2
ticpu merged 1 commit into
masterfrom
workflow-permission

Conversation

@ticpu

@ticpu ticpu commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/ticpu/freeswitch-log-parser/security/code-scanning/1

Add explicit permissions to the workflow so default token scope is minimized.
Best fix here (without changing functionality) is:

  1. Set a restrictive workflow-level default:
    • permissions: contents: read
  2. Override only the test job (which updates a gist badge) with write access needed for that operation:
    • permissions: contents: read
    • permissions: gist: write

This keeps the package job read-only and grants extra privilege only where needed.

Edit file: .github/workflows/ci.yml

  • Insert workflow-level permissions after the on: block.
  • Insert permissions under jobs.test.

No imports/dependencies/methods are needed.

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

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@ticpu
ticpu marked this pull request as ready for review August 7, 2026 16:42
@ticpu
ticpu merged commit 252aecc into master Aug 7, 2026
3 checks passed
@ticpu
ticpu deleted the workflow-permission branch August 7, 2026 16:46
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