Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Reduce permissions of semantic-pull-request check #343

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dgl
Copy link

@dgl dgl commented Dec 9, 2024

Description

  • What is the purpose of this PR?

Reduce permissions of the lint-pr github action.

  • What was changed?

Add a permissions block to lint-pr. This is now the recommended option in:
https://github.com/amannn/action-semantic-pull-request#installation

  • Why was it changed?

Recently a project has been attacked using pull_request_target see full details. This project/action is not vulnerable to that, but there is no reason for the token associated with this action to have write permissions.

  • Does this address any existing issues or enhancement requests?

n/a, improves security posture of the project.

Type of change

Please select the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code Style Update (formatting, renaming)
  • Refactor (code changes that do not fix a bug or add a feature)
  • Documentation Update
  • Other (please describe): CI Security

How Has This Been Tested?

Only affects CI; CI will test it.

Can check by looking at "Set up job" and then expanding "GITHUB_TOKEN Permissions" on the "Validate PR title" PR check. Before it will say "write", after it should only have "read". (Note because this is using pull_request_target this won't be visible on this PR, only once merged to main).

@dgl dgl changed the title Reduce permissions of semantic-pull-request check ci: Reduce permissions of semantic-pull-request check Dec 9, 2024
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