Commit 34be1de
fix: Workflow does not contain permissions (#59)
Potential fix for
[https://github.com/aws-samples/serverless-full-stack-webapp-starter-kit/security/code-scanning/3](https://github.com/aws-samples/serverless-full-stack-webapp-starter-kit/security/code-scanning/3)
To fix the problem, add a `permissions` block to the workflow file
`.github/workflows/build.yml`. This block can be placed at the top level
(applies to all jobs) or at the job level (applies to individual jobs).
Since neither job appears to require write access, the minimal required
permission is `contents: read`. The best way to fix this is to add the
following block after the workflow `name` and before the `on` key:
```yaml
permissions:
contents: read
```
This ensures that the GITHUB_TOKEN used by all jobs in the workflow only
has read access to repository contents, reducing the risk of privilege
escalation or accidental modification of repository resources.
_Suggested fixes powered by Copilot Autofix. Review carefully before
merging._
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>1 parent d0f3acc commit 34be1de
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
0 commit comments