Skip to content

Potential fix for code scanning alert no. 3: Workflow does not contain permissions - #149

Merged
aaschmid merged 2 commits into
mainfrom
alert-autofix-3
Feb 7, 2026
Merged

Potential fix for code scanning alert no. 3: Workflow does not contain permissions#149
aaschmid merged 2 commits into
mainfrom
alert-autofix-3

Conversation

@aaschmid

@aaschmid aaschmid commented Feb 2, 2026

Copy link
Copy Markdown
Member

Potential fix for https://github.com/TNG/junit-dataprovider/security/code-scanning/3

To fix the problem, we need to add an explicit permissions block that grants only the minimal permissions required by this CI job. Since the job just checks out code, sets up Java/Gradle, and runs ./gradlew build, it only needs read access to the repository contents. The recommended starting point from the warning is contents: read, which will override any broader org/repo defaults.

The best minimal change without altering existing functionality is to add a permissions stanza at the workflow root (top level), so it applies to all jobs in this workflow. Concretely, edit .github/workflows/gradle.yml to insert:

permissions:
  contents: read

between the on: block and the jobs: block. This does not require any imports or additional methods; it is purely a configuration addition in the YAML file.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

aaschmid and others added 2 commits February 2, 2026 16:01
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@aaschmid
aaschmid marked this pull request as ready for review February 2, 2026 16:22
@aaschmid
aaschmid merged commit 720efa5 into main Feb 7, 2026
17 of 19 checks passed
@aaschmid
aaschmid deleted the alert-autofix-3 branch February 7, 2026 11:15
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.

1 participant