Skip to content

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

Merged
Ghostv13-dev merged 1 commit into
mainfrom
npm-install-@ngrok/ngrok
Sep 18, 2026
Merged

Ghostv13-dev merged 1 commit into
mainfrom
npm-install-@ngrok/ngrok

Conversation

@Ghostv13-dev

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/Ghostv13-dev/telegram-bot-api/security/code-scanning/2

Add an explicit workflow-level permissions block so all jobs inherit minimal token scope unless overridden. For this workflow, contents: read is the appropriate least-privilege baseline because the jobs only need to check out code and run shell tests; no write operations are present.

Best single fix (without changing behavior): in .github/workflows/test.yml, insert:

permissions:
  contents: read

directly after the on: triggers block and before jobs:. This applies uniformly to both entrypoint and file-serving jobs and addresses the CodeQL finding.

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>
@Ghostv13-dev Ghostv13-dev self-assigned this Sep 14, 2026
@Ghostv13-dev
Ghostv13-dev marked this pull request as ready for review September 14, 2026 18:04
@Ghostv13-dev
Ghostv13-dev merged commit 784b571 into main Sep 18, 2026
11 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