Skip to content

Commit 34be1de

Browse files
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

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
permissions:
2+
contents: read
13
name: Build
24
on:
35
push:

0 commit comments

Comments
 (0)