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

Add a remediation for the workflow_no_pull_request_target rule #202

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

jhrozek
Copy link
Contributor

@jhrozek jhrozek commented Oct 27, 2024

This PR depends on having mindersec/minder#4830
merged first as it takes the remediation function added there into
effect.

The remediation works as follows:

  • if there are any instances of pull_request target objects those are
    removed
  • else if there are any instances of pull_request strings in an array
    those are removed
  • if the resulting array of array of objects would have length 0,
    workflow_dispatch is added instead

Fixes: #201

This PR depends on having mindersec/minder#4830
merged first as it takes the remediation function added there into
effect.

The remediation works as follows:
 - if there are any instances of pull_request target objects those are
   removed
 - else if there are any instances of pull_request strings in an array
   those are removed
 - if the resulting array of array of objects would have length 0,
   `workflow_dispatch` is added instead

Fixes: #201
@jhrozek jhrozek requested a review from a team as a code owner October 27, 2024 12:57
@jhrozek jhrozek merged commit 76bc8a5 into main Nov 5, 2024
5 checks passed
@jhrozek jhrozek deleted the no_pr_target_remediation branch November 5, 2024 13:01
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.

Add a remediation for the no_pull_request_target rule
2 participants