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

Implement ability to require workflows to pass before merging in organization repository rulesets #607

Open
laura-maree-sp opened this issue Mar 18, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@laura-maree-sp
Copy link

laura-maree-sp commented Mar 18, 2024

Prerequisites:

New Feature

Please describe the desired new functionality:

After trying to implement an organization repository ruleset via safe-settings, I have been unable to require a workflow to pass before merging in the ruleset. This is currently an option in the UI when creating a repository ruleset for an organization, and it can also be implemented via the API.

I did not see this as an option in the safe-settings example docs, but I did try this in the rules section of the repository ruleset:

      rules:
      - type: deletion
      - type: non_fast_forward
      - type: workflows
        parameters: 
          workflows:
          - path: .github/workflows/check.yml
            ref: main
            repository_id: 349423409

This did not work for me, so I'm assuming this is either not implemented, or I have an error in the above. Any feedback for this feature?

@laura-maree-sp laura-maree-sp added the enhancement New feature or request label Mar 18, 2024
@ElioDiNino
Copy link
Contributor

Hi @laura-maree-sp. The required workflow rule is supported as I recently got it working for the organization I am part of. The first thing to note is that this rule is limited to enterprise customers, so if the organization is not part of an enterprise then this feature will not be available.

In terms of the issue with the rule you pasted, simply change ref: main to ref: refs/heads/main. Everything else about your configuration looks good.

P.S. It is helpful to turn on debug logs for the application deployment to find sources of error (which is what I had to do to figure out why my configuration - which had the same issue as yours - wasn't working).

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