Skip to content

Commit 1e4e12f

Browse files
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). ⚠️ Report is 8 commits behind head on master. Additional details and impacted files 🚀 New features to boost your workflow: ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems. 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges. -------------------------------- Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 2c233ab commit 1e4e12f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.github/workflows/tx-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: Tx
2+
permissions:
3+
contents: read
24
on:
35
push:
46
branches: [master, develop]

0 commit comments

Comments
 (0)