Skip to content

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#74

Draft
taru-garg-hashicorp wants to merge 1 commit into
mainfrom
alert-autofix-1
Draft

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#74
taru-garg-hashicorp wants to merge 1 commit into
mainfrom
alert-autofix-1

Conversation

@taru-garg-hashicorp
Copy link
Copy Markdown

Potential fix for https://github.com/hashicorp/github-actions-core/security/code-scanning/1

Add an explicit permissions block to the workflow so GITHUB_TOKEN is constrained to least privilege.
Best fix here (without changing functionality): define workflow-level permissions with contents: read, which is sufficient for actions/checkout and running Super-Linter in this configuration.

Change file: .github/workflows/superlinter.yml
Change region: near the top-level keys (name, on, jobs) by inserting:

permissions:
  contents: read

No imports, methods, or external dependencies are needed.

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