Skip to content

fix(ci): restrict GITHUB_TOKEN permissions in lint-and-test workflow - #232

Merged
furykerry merged 1 commit into
openkruise:masterfrom
furykerry:fix/lint-workflow-permissions
Nov 5, 2026
Merged

furykerry merged 1 commit into
openkruise:masterfrom
furykerry:fix/lint-workflow-permissions

Conversation

@furykerry

Copy link
Copy Markdown
Member

Summary

  • Add a workflow-level permissions: contents: read block to .github/workflows/lint-and-test.yml, so the PR lint/install job runs with a least-privilege GITHUB_TOKEN instead of inheriting repository defaults.
  • The job only checks out code and runs ct lint / ct install against a local Kind cluster, so read access to contents is sufficient.
  • Resolves CodeQL code-scanning alert #7 (actions/missing-workflow-permissions).

Test plan

  • Linting and Testing workflow runs successfully on this PR with the restricted token
  • CodeQL alert Add chart 1.0.1 #7 is closed after merge to master

Declare an explicit read-only token scope so the PR lint/install job
follows least privilege regardless of repository defaults. Resolves
CodeQL alert actions/missing-workflow-permissions (openkruise#7).

Signed-off-by: 守辰 <shouchen.zz@alibaba-inc.com>
@kruise-bot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from furykerry by writing /assign @furykerry in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@furykerry
furykerry merged commit fc8f8ac into openkruise:master Nov 5, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants