Skip to content

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

Merged
aaschmid merged 1 commit into
mainfrom
alert-autofix-4
Feb 2, 2026
Merged

aaschmid merged 1 commit into
mainfrom
alert-autofix-4

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/4

In general, the fix is to add an explicit permissions block to restrict the GITHUB_TOKEN to the minimum needed for this workflow. For a Gradle wrapper validation workflow that only checks out code and runs a validation action, contents: read is sufficient.

The best fix here, without changing functionality, is to add a job-level permissions block under the validation job in .github/workflows/gradle-wrapper-validation.yml. This keeps the scope local to this job and does not affect other workflows. Concretely, in that file, under jobs: validation:, add:

    permissions:
      contents: read

indented to align with name: and runs-on:. No additional imports, methods, or definitions are needed because this is just YAML configuration for GitHub Actions.

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

…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 15:11
@aaschmid
aaschmid merged commit f76a9c0 into main Feb 2, 2026
17 of 19 checks passed
@aaschmid
aaschmid deleted the alert-autofix-4 branch February 2, 2026 16:21
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