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 github_enterprise_actions_runner_group #2158

Merged
merged 6 commits into from
Mar 18, 2024

Conversation

bradam12
Copy link
Contributor

@bradam12 bradam12 commented Feb 18, 2024

Resolves #1482

This adds a new resource github_enterprise_actions_runner_group to control runner groups at the enterprise level.

Additional attribute database_id added to data.github_enterprise and resource.github_enterprise_organization.
The id fields on these two items are the node ID used for v4, and the "traditional" ID is exposed via DatabaseId. Other items use node_id and id, but I didn't want to introduce a breaking change so I just added as new attributes.

data "github_enterprise" "enterprise" {
  slug = "my-enterprise"
}

resource "github_enterprise_organization" "enterprise_organization" {
  enterprise_id = data.github_enterprise.enterprise.id
  name          = "my-organization"
  billing_email = "octocat@octo.cat"
  admin_logins  = ["octocat"]
}

resource "github_enterprise_actions_runner_group" "example" {
  name                       = "my-awesome-runner-group"
  enterprise_slug            = data.github_enterprise.enterprise.slug
  allows_public_repositories = true
  visibility                 = "selected"
  selected_organization_ids  = [github_enterprise_organization.enterprise_organization.database_id]
  restricted_to_workflows    = true
  selected_workflows         = ["my-organization/my-repo/.github/workflows/cool-workflow.yaml@refs/tags/v1"]
}

Tests are added and running successfully. I set the following env vars: GITHUB_ORGANIZATION, GITHUB_BASE_URL, GITHUB_TOKEN, ENTERPRISE_ACCOUNT, ENTERPRISE_SLUG

--- PASS: TestAccGithubActionsEnterpriseRunnerGroup (88.91s)
    --- PASS: TestAccGithubActionsEnterpriseRunnerGroup/creates_enterprise_runner_groups_without_error (9.65s)
        --- PASS: TestAccGithubActionsEnterpriseRunnerGroup/creates_enterprise_runner_groups_without_error/with_an_enterprise_account (9.65s)
    --- PASS: TestAccGithubActionsEnterpriseRunnerGroup/manages_runner_group_visibility_to_selected_orgs (29.34s)
        --- PASS: TestAccGithubActionsEnterpriseRunnerGroup/manages_runner_group_visibility_to_selected_orgs/with_an_enterprise_account (29.34s)
    --- PASS: TestAccGithubActionsEnterpriseRunnerGroup/imports_an_all_runner_group_without_error (13.57s)
        --- PASS: TestAccGithubActionsEnterpriseRunnerGroup/imports_an_all_runner_group_without_error/with_an_enterprise_account (13.57s)
    --- PASS: TestAccGithubActionsEnterpriseRunnerGroup/imports_a_runner_group_with_selected_orgs_without_error (36.36s)
        --- PASS: TestAccGithubActionsEnterpriseRunnerGroup/imports_a_runner_group_with_selected_orgs_without_error/with_an_enterprise_account (36.36s)
PASS
ok      github.com/integrations/terraform-provider-github/v6/github     88.995s

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?

Please see our docs on breaking changes to help!

  • Yes
  • No

@bradam12 bradam12 changed the title feat: add github_enterprise_actions_runner_group feat: add github_enterprise_actions_runner_group Feb 18, 2024
@ajschmidt8
Copy link

@bradam12, thanks for your work here. My team could really use this feature.

Looking forward to seeing it merged and deployed.

@ajschmidt8
Copy link

@bradam12, what's the status of this PR? Is there anything left to do or can I tag a maintainer for a final review?

Have these changes been tested on your Enterprise account?

@bradam12
Copy link
Contributor Author

@bradam12, what's the status of this PR? Is there anything left to do or can I tag a maintainer for a final review?

Have these changes been tested on your Enterprise account?

Nothing left on my end. I've tested this in our GHES.

@ajschmidt8
Copy link

ajschmidt8 commented Mar 11, 2024

@kfcampbell, can you review/approve/merge/deploy this when you have some time?

@bradam12
Copy link
Contributor Author

I'd love to get this out soon. Is there anything else you need from me @kfcampbell?

@kfcampbell kfcampbell merged commit b1243e4 into integrations:main Mar 18, 2024
3 checks passed
@kfcampbell
Copy link
Member

No, I'll get this released shortly. Thank you for your patience.

@bradam12 bradam12 deleted the ghes-runner-groups branch March 18, 2024 21:22
kireque referenced this pull request in kireque/home-ops Mar 22, 2024
This PR contains the following updates:

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

---

### Release Notes

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

###
[`v6.2.0`](https://github.com/integrations/terraform-provider-github/releases/tag/v6.2.0)

[Compare
Source](https://github.com/integrations/terraform-provider-github/compare/v6.1.0...v6.2.0)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

##### Features

- feat: add `github_enterprise_actions_runner_group` by
[@&#8203;bradam12](https://github.com/bradam12) in
[https://github.com/integrations/terraform-provider-github/pull/2158](https://github.com/integrations/terraform-provider-github/pull/2158)
- Feat: Fixes abandoned PR
[#&#8203;2017](https://github.com/integrations/terraform-provider-github/issues/2017):
Add support for the require_last_push_approval flag in
github_branch_protection_v3 by
[@&#8203;georgekaz](https://github.com/georgekaz) in
[https://github.com/integrations/terraform-provider-github/pull/2199](https://github.com/integrations/terraform-provider-github/pull/2199)

##### Bugfixes

- fix(data_source_github_rest_api): just read body and convert bytes
into string by [@&#8203;riezebosch](https://github.com/riezebosch) in
[https://github.com/integrations/terraform-provider-github/pull/2152](https://github.com/integrations/terraform-provider-github/pull/2152)

##### 🛠️ Maintenance

- build(deps): bump golang.org/x/oauth2 from 0.17.0 to 0.18.0 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/integrations/terraform-provider-github/pull/2189](https://github.com/integrations/terraform-provider-github/pull/2189)
- build(deps): bump google.golang.org/protobuf from 1.32.0 to 1.33.0 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/integrations/terraform-provider-github/pull/2194](https://github.com/integrations/terraform-provider-github/pull/2194)

**Full Changelog**:
integrations/terraform-provider-github@v6.1.0...v6.2.0

###
[`v6.1.0`](https://github.com/integrations/terraform-provider-github/releases/tag/v6.1.0)

[Compare
Source](https://github.com/integrations/terraform-provider-github/compare/v6.0.1...v6.1.0)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

- fix: validation rule for `results_per_page` of `github_repositories`
data source by [@&#8203;dschniepp](https://github.com/dschniepp) in
[https://github.com/integrations/terraform-provider-github/pull/2185](https://github.com/integrations/terraform-provider-github/pull/2185)
- fix: Prevent loading of allowed actions if not configured by
[@&#8203;Danielku15](https://github.com/Danielku15) in
[https://github.com/integrations/terraform-provider-github/pull/2186](https://github.com/integrations/terraform-provider-github/pull/2186)
- fix(data_source_github_rest_api): only allow for 404 on err by
[@&#8203;riezebosch](https://github.com/riezebosch) in
[https://github.com/integrations/terraform-provider-github/pull/2154](https://github.com/integrations/terraform-provider-github/pull/2154)
- fix: error if autolink reference not found by
[@&#8203;bradam12](https://github.com/bradam12) in
[https://github.com/integrations/terraform-provider-github/pull/2164](https://github.com/integrations/terraform-provider-github/pull/2164)
- feat: Add `github_actions_enterprise_permissions` by
[@&#8203;ErikElkins](https://github.com/ErikElkins) in
[https://github.com/integrations/terraform-provider-github/pull/2155](https://github.com/integrations/terraform-provider-github/pull/2155)
- docs: configure release notes categories based on labels by
[@&#8203;laughedelic](https://github.com/laughedelic) in
[https://github.com/integrations/terraform-provider-github/pull/2184](https://github.com/integrations/terraform-provider-github/pull/2184)

#### New Contributors

- [@&#8203;dschniepp](https://github.com/dschniepp) made their first
contribution in
[https://github.com/integrations/terraform-provider-github/pull/2185](https://github.com/integrations/terraform-provider-github/pull/2185)
- [@&#8203;riezebosch](https://github.com/riezebosch) made their first
contribution in
[https://github.com/integrations/terraform-provider-github/pull/2154](https://github.com/integrations/terraform-provider-github/pull/2154)
- [@&#8203;bradam12](https://github.com/bradam12) made their first
contribution in
[https://github.com/integrations/terraform-provider-github/pull/2164](https://github.com/integrations/terraform-provider-github/pull/2164)
- [@&#8203;ErikElkins](https://github.com/ErikElkins) made their first
contribution in
[https://github.com/integrations/terraform-provider-github/pull/2155](https://github.com/integrations/terraform-provider-github/pull/2155)
- [@&#8203;laughedelic](https://github.com/laughedelic) made their
first contribution in
[https://github.com/integrations/terraform-provider-github/pull/2184](https://github.com/integrations/terraform-provider-github/pull/2184)

**Full Changelog**:
integrations/terraform-provider-github@v6.0.1...v6.1.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://github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNDAuMSIsInVwZGF0ZWRJblZlciI6IjM3LjI1Ny4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

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]: Support managing enterprise Actions runner groups
3 participants