Commit 1e4e12f
Potential fix for code scanning alert no. 67: Workflow does not contain permissions (#74)
To fix this issue, add a permissions block with least privilege at the root level of the workflow (just after the name: or the on: block), or scoped to the test-tx job if different jobs have distinct needs. For this workflow, since it primarily checks out code, installs dependencies, runs lint, coverage, and pushes coverage data (to Codecov, not back to GitHub), it only requires read access to repository contents. Thus, set permissions: contents: read at the workflow level, which restricts the GITHUB_TOKEN in all jobs unless overridden.
Edit .github/workflows/tx-build.yml:
Insert the following under the name: Tx line (before on:):
permissions:
contents: read
No method, import, or other code is needed; this is a pure configuration change.
Suggested fixes powered by Copilot Autofix. Review carefully before merging.
Summary by Sourcery
CI:
Add permissions.contents: read at the root of .github/workflows/tx-build.yml to grant only read access to repository contents
--------------------
#74 (comment)
--------------------
#74 (comment)
Codecov Report
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.13%. Comparing base (ff99c86) to head (c4fd07e).
1 parent 2c233ab commit 1e4e12f
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
0 commit comments