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: Support rule type code_scanning #2436

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ihor-hrytskiv
Copy link

@ihor-hrytskiv ihor-hrytskiv commented Oct 23, 2024

Support rule type code_scanning for github_organization_ruleset and github_repository_ruleset

Resolves #2310

Example:

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

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

    rules {
        required_code_scanning {
            required_code_scanning_tool {
                alerts_threshold          = "errors"
                security_alerts_threshold = "high_or_higher"
                tool                      = "CodeQL"
            }
        }
    }
}

resource "github_repository_ruleset" "repo_ruleset" {
    name        = "example"
    repository  = data.github_repository.workflow_repo.name
    target      = "branch"
    enforcement = "active"

    rules {
        required_code_scanning {
            required_code_scanning_tool {
                alerts_threshold          = "errors"
                security_alerts_threshold = "high_or_higher"
                tool                      = "CodeQL"
            }
        }
    }
}

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

@ihor-hrytskiv ihor-hrytskiv changed the title feat: support rule type code_scanning feat: Support rule type code_scanning Oct 23, 2024
@kfcampbell
Copy link
Member

@ihor-hrytskiv would it be possible to split out the google/go-github v66 upgrade to a separate PR? It makes it easier to roll back if something goes wrong with either part of the change, which we've had happen before.

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 rule type code_scanning for github_organization_ruleset
2 participants