Skip to content

Commit 1f7950b

Browse files
Potential fix for code scanning alert no. 1: Workflow does not contain permissions (#3)
Potential fix for [https://github.com/capire/xflights-java/security/code-scanning/1](https://github.com/capire/xflights-java/security/code-scanning/1) To fix this issue, add a minimal explicit `permissions` block at the top level of the workflow YAML file (`.github/workflows/maven.yml`), before the `jobs:` section. Since this workflow only checks out code and builds with Maven (reads source, runs tests, does not push, open issues, etc.), it suffices to grant only `contents: read`. This restricts the `GITHUB_TOKEN` to the least privilege needed and avoids unintended write access. You do not need to modify existing `jobs` or `steps`. Ensure the block uses correct YAML indentation. --- _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 8179c4c commit 1f7950b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.github/workflows/maven.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
33

44
name: Java CI with Maven
5+
permissions:
6+
contents: read
57

68
on:
79
pull_request:

0 commit comments

Comments
 (0)