Skip to content

Potential fix for code scanning alert no. 4: Workflow does not contain permissions#87

Merged
libotony merged 1 commit intomasterfrom
alert-autofix-4
Mar 23, 2026
Merged

Potential fix for code scanning alert no. 4: Workflow does not contain permissions#87
libotony merged 1 commit intomasterfrom
alert-autofix-4

Conversation

@libotony
Copy link
Copy Markdown
Member

Potential fix for https://github.com/vechain/thor-devkit.js/security/code-scanning/4

In general, the fix is to explicitly add a permissions block that limits GITHUB_TOKEN to the minimal rights needed by the workflow. This can be done at the top level of the workflow (applies to all jobs) or per job. Here, both jobs only need to read the repo contents; Coveralls uses the token to associate coverage with the commit/PR, which typically only needs contents: read in this workflow context. We therefore add a root-level permissions section with contents: read so both test and finish jobs inherit it.

Concretely, in .github/workflows/test.yml, add a permissions: block right after the name: Unit Test line. The block should specify contents: read. No other changes to the steps or existing behavior are required. No imports or additional methods are needed since this is YAML configuration only.

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>
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 97.283%. remained the same
when pulling 234769c on alert-autofix-4
into f2402d8 on master.

@libotony libotony marked this pull request as ready for review March 23, 2026 08:34
@libotony libotony merged commit 5fe5cf0 into master Mar 23, 2026
8 checks passed
@libotony libotony deleted the alert-autofix-4 branch March 23, 2026 08:34
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