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

Specify branch for individual checks #63

Open
jan-verb opened this issue Aug 17, 2023 · 3 comments
Open

Specify branch for individual checks #63

jan-verb opened this issue Aug 17, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@jan-verb
Copy link

Description

Currently, you can only specify what branch you want all of your checks to run on via the policy-branch input.

Propose Solution

It would be nice if you could specify different branches for different checks. For example, I'd like the Dependabot check to always run against main, so as to block merges to main until those Dependabot findings have been resolved, but I'd like the Secret Scanning alerts to run on my feature branch so as to ensure that no secrets are pushed up to it.

@jan-verb jan-verb added the enhancement New feature or request label Aug 17, 2023
@GeekMasher
Copy link
Collaborator

This is a very interesting idea and might be something we can add to the v3 spec.

Would you say maybe something like this in the threat modelling block might work?

# ...
threatmodels:
  # ...
  advanced-security-high:
    uses: ./policies/high.yml
    branches:
      - main
      - dev
      - release/*
    repositories:
      - advanced-security/policy-as-code
      - advanced-security/codeql-queries

So you have to match on the repository and the branch for the policy to apply.

@jan-verb
Copy link
Author

I may not be understanding you correctly, but I don't think so.

Per my solution above, something like this is what I had in mind:

dependabot:
  enabled: true
  branches:
    - main
    - master

secretscanning:
  enabled: true
  # not specifying `branches` defaults to all branches

@jan-verb
Copy link
Author

Hi @GeekMasher, I just wanted to see if there's any update here, as I'll be continuing to work on GHAS at my company shortly, where this would be very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants