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

Invalid rules: 'Workflows' error when using the example yaml for organization ruleset #659

Open
mikyjpeg opened this issue Aug 1, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mikyjpeg
Copy link

mikyjpeg commented Aug 1, 2024

Problem Description

We're using the safe-setting to implement a ruleset at organisation level. The ruleset is created and works fine until we try to add a workflow rule. In such case, using a configuration that's pretty much identical to the one provided as example (https://github.com/github/safe-settings/blob/main-enterprise/docs/sample-settings/settings.yml#L343-L355) we receive an Invalid rules: 'Workflows' from the safe-setting execution

What is actually happening

This is the configuration part that trigger the issue:

rules:
      # # Choose which workflows must pass before branches can be merged.
      - type: workflows
        parameters:
          workflows:
            - path: .github/workflows/myworkflow.yml
              repository_id: 111111111 #actual id redacted
              ref: refs/heads/main

if the workflow type part is commented out the rules are applied correctly.

What is the expected behavior

The expected behavior is for the ruleset to be updated with the additional rule

Error output, if available

safe settings execution returns the following error

HttpError: Validation Failed: "Invalid rules: 'Workflows'"

The error seems to imply git hub api doesn't like the "workflow" object. However, the REST API docs seems to confirm the structure is correct as for https://docs.github.com/en/rest/orgs/rules?apiVersion=2022-11-28#create-an-organization-repository-rulesetfor

Context

Are you using the hosted instance of probot/settings or running your own?

We're running our own instance

If running your own instance, are you using it with github.com or GitHub Enterprise?

We are using GitHub enterprise but Cloud hosted on github.com

Version of probot/settings

safe settings 2.1.10

Version of GitHub Enterprise

the live one, we use cloud GHE

@mikyjpeg mikyjpeg added the bug Something isn't working label Aug 1, 2024
@ron-nutrino
Copy link

I'm experiencing the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants