Skip to content

Conversation

@lefty01
Copy link
Owner

@lefty01 lefty01 commented Jan 5, 2026

Potential fix for https://github.com/lefty01/ESP32_TTGO_FTMS/security/code-scanning/2

In general, the fix is to explicitly declare a permissions block that scopes the GITHUB_TOKEN to the minimum required rights. For this workflow, only read access to the repository contents is needed, since it performs a checkout and local build but does not write to the repo, create issues, or modify pull requests.

The best minimally invasive change is to add a single permissions block at the workflow root (top level, alongside on: and jobs:) specifying contents: read. This will apply to all jobs that do not have their own permissions block, which includes the build job. No functional behavior of the build steps changes; only the token’s capabilities are reduced. Concretely, in .github/workflows/platformio-ci.yml, insert:

permissions:
  contents: read

between the on: block and the jobs: block (after line 7, before line 10 in the provided snippet). No imports, methods, or other definitions are needed since this is purely a workflow configuration change.

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>
@lefty01 lefty01 marked this pull request as ready for review January 5, 2026 20:50
@lefty01 lefty01 merged commit 2aea037 into main Jan 6, 2026
8 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.

2 participants