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

feat: Add required_workflows to github_organization_ruleset #2082

Merged
merged 3 commits into from
Jan 16, 2024
Merged

feat: Add required_workflows to github_organization_ruleset #2082

merged 3 commits into from
Jan 16, 2024

Conversation

relusc
Copy link
Contributor

@relusc relusc commented Jan 8, 2024

Resolves #1970


This adds a new field required_workflows to github_organization_ruleset to be able to specify workflows that must pass.

Example:

data "github_repository" "workflow_repo" {
    name = "workflow_repo"
}

resource "github_organization_ruleset" "ruleset" {
    name        = "example"
    target      = "branch"
    enforcement = "active"

    rules {
      required_workflows {
        required_workflow {
          repository_id = data.github_repository.workflow_repo.repo_id
          path          = "path/to/workflow.yaml"
          ref           = "main"
        }

        required_workflow {
          repository_id = data.github_repository.workflow_repo.repo_id
          path          = "path/to/second_workflow.yaml"
          ref           = "main"
        }
      }
    }
}

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

  • Yes
  • No

Copy link
Contributor

@nickfloyd nickfloyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contributions here @relusc! ❤️

@nickfloyd nickfloyd changed the title Add required_workflows to github_organization_ruleset feat: Add required_workflows to github_organization_ruleset Jan 16, 2024
@nickfloyd nickfloyd merged commit d975c70 into integrations:main Jan 16, 2024
3 checks passed
@relusc relusc deleted the relusc-required-workflows-ruleset branch January 17, 2024 06:43
kireque pushed a commit to kireque/home-ops that referenced this pull request Feb 7, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github](https://registry.terraform.io/providers/integrations/github)
([source](https://togithub.com/integrations/terraform-provider-github))
| required_provider | minor | `5.44.0` -> `5.45.0` |

---

### Release Notes

<details>
<summary>integrations/terraform-provider-github (github)</summary>

###
[`v5.45.0`](https://togithub.com/integrations/terraform-provider-github/releases/tag/v5.45.0)

[Compare
Source](https://togithub.com/integrations/terraform-provider-github/compare/v5.44.0...v5.45.0)

#### What's Changed

- build(deps): bump golang.org/x/crypto from 0.17.0 to 0.18.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[integrations/terraform-provider-github#2098
- build(deps): bump golang.org/x/oauth2 from 0.15.0 to 0.16.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[integrations/terraform-provider-github#2097
- docs: Adds description for overwrite_on_create option. by
[@&#8203;Nmishin](https://togithub.com/Nmishin) in
[integrations/terraform-provider-github#2095
- docs: Update branch protection documentation by
[@&#8203;LiamMacP](https://togithub.com/LiamMacP) in
[integrations/terraform-provider-github#2085
- feat: Add `required_workflows` to `github_organization_ruleset` by
[@&#8203;relusc](https://togithub.com/relusc) in
[integrations/terraform-provider-github#2082
- Fix ruleset bypass actors diff issues by
[@&#8203;o-sama](https://togithub.com/o-sama) in
[integrations/terraform-provider-github#1950

#### New Contributors

- [@&#8203;LiamMacP](https://togithub.com/LiamMacP) made their first
contribution in
[integrations/terraform-provider-github#2085

**Full Changelog**:
integrations/terraform-provider-github@v5.44.0...v5.45.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNzQuMyIsInVwZGF0ZWRJblZlciI6IjM3LjE3NC4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: kireque-bot[bot] <143391978+kireque-bot[bot]@users.noreply.github.com>
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.

[FEAT]: Add "Require workflows to pass before merging" support to github_organization_ruleset
2 participants