Commit 1b16805
Potential fix for code scanning alert no. 1: Workflow does not contain permissions (#119)
Potential fix for
[https://github.com/psake/PowerShellBuild/security/code-scanning/1](https://github.com/psake/PowerShellBuild/security/code-scanning/1)
In general, the fix is to explicitly define a `permissions:` block for
the workflow or individual jobs, granting only the scopes actually
needed. For most build/publish workflows that only need to read the
repository contents, `contents: read` is an appropriate minimal default.
If later steps need more permissions (e.g., to create releases or write
issues), those can be added explicitly.
For this specific file, the simplest and safest fix without altering
functionality is to add a workflow-level `permissions:` block with
`contents: read`. This will apply to the `publish` job because it
currently has no `permissions` of its own. Concretely, in
`.github/workflows/publish.yaml`, insert:
```yaml
permissions:
contents: read
```
between the `on:` block and the `jobs:` block. No additional imports or
dependencies are needed, and no other lines in the workflow need to
change.
_Suggested fixes powered by Copilot Autofix. Review carefully before
merging._
Signed-off-by: Gilbert Sanchez <me@gilbertsanchez.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>1 parent 000f2ca commit 1b16805
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
0 commit comments