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

Branch protection config error. #3

Open
jeffmendoza opened this issue Mar 8, 2024 · 1 comment
Open

Branch protection config error. #3

jeffmendoza opened this issue Mar 8, 2024 · 1 comment

Comments

@jeffmendoza
Copy link

@gkunz Allstar is throwing an error on this line here

"json: cannot unmarshal bool into Go struct field OrgConfig.requireStatusChecks of type []branch.StatusCheck"

requireStatusChecks: false

Here is the documentation for that field

// RequireStatusChecks is a list of status checks that are required in
	// order to merge into the protected branch. Each entry must specify
	// the context, and optionally an appID.
	Require[StatusCheck](https://pkg.go.dev/github.com/ossf/[email protected]/pkg/policies/branch#StatusCheck)s []StatusCheck `json:"requireStatusChecks"`

https://pkg.go.dev/github.com/ossf/[email protected]/pkg/policies/branch#OrgConfig
https://pkg.go.dev/github.com/ossf/[email protected]/pkg/policies/branch#StatusCheck

Some docs
https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches#require-status-checks-before-merging
https://docs.github.com/en/rest/branches/branch-protection?apiVersion=2022-11-28#get-status-checks-protection

So it should be something like this:

requireStatusChecks:
- context: DCO
  appID: 123
- context: continuous-integration/travis-ci
@gkunz
Copy link
Collaborator

gkunz commented Mar 10, 2024

Hi @jeffmendoza, thanks a lot! I noticed my mistake that this option is a list rather than a bool and removed it from the configuration for now. I am currently still working on a sample config that I understand and could role out across the org. I am currently a bit puzzled by the fact that Allstar still complains about the branch protection policy, but I keep debugging my config.

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

No branches or pull requests

2 participants