Add github_repository_environment_deployment_protection_rule resource#3566
Open
stockmaj wants to merge 5 commits into
Open
Add github_repository_environment_deployment_protection_rule resource#3566stockmaj wants to merge 5 commits into
stockmaj wants to merge 5 commits into
Conversation
Enables a GitHub App as a custom deployment protection rule on an environment (the deployment_protection_rule gate), which the provider previously could not express declaratively — resolves integrations#2225. CRUD + import over go-github's Create/Get/DisableCustomDeploymentProtectionRule; schema is repository + environment + integration_id, mirroring the existing github_repository_environment_deployment_policy resource. Based on v6.13.0.
|
👋 Hi, and thank you for this contribution! This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can. You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions. 🤖 This is an automated message. |
InternalValidate rejects the resource: with no UpdateContext, every attribute must be ForceNew. repository was Required-only. Mark it ForceNew and drop the now-redundant diffRepository CustomizeDiff (it keys off a repository_id this resource doesn't have). `go test -run TestProvider` (InternalValidate) passes.
main upgraded go-github v88 -> v89; the CreateCustomDeploymentProtectionRule request type moved packages. Match the rest of the provider.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
github_repository_environment_deployment_protection_ruleresource that enables a GitHub App as a custom deployment protection rule on an environment — thedeployment_protection_rulegate. The provider can currently manage required reviewers and branch policies on an environment, but has no way to declaratively attach an App-based deployment protection rule.Resolves #2225.
Details
CreateCustomDeploymentProtectionRule/GetCustomDeploymentProtectionRule/DisableCustomDeploymentProtectionRule.repository+environment+integration_id(the App's ID), mirroring the existinggithub_repository_environment_deployment_policyresource for consistency.<repository>:<environment>:<rule_id>.docs/resources/.Branch is cut from the
v6.13.0release.