Skip to content

Conversation

@sprioriello
Copy link

@sprioriello sprioriello commented Jan 30, 2026

This commit adds a new resource github_organization_security_configuration & github_enterprise_security_configuration to manage Code Security Configurations at the organization & enterprise level respectively. It includes:

  • Resource implementation.
  • Acceptance tests.
  • Documentation.
  • Provider registration.

Resolves #2412


Before the change?

  • Resource not available.

After the change?

  • Implement code security configuration resource on organizational level.

Pull request checklist

  • Schema migrations have been created if needed (example)
  • 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

Tests

│ ==> Running acceptance tests on branch: 🌿 feat/organization-security-configuration 🌿...                                                                                    │
│ TF_ACC=1 CGO_ENABLED=0 go test ./github/... -v -run '^TestAcc' -run='TestAccGithubOrganizationSecurityConfiguration'  -timeout 120m -count=1                                     │
│ === RUN   TestAccGithubOrganizationSecurityConfiguration                                                                                                                         │
│ === RUN   TestAccGithubOrganizationSecurityConfiguration/creates_organization_security_configuration_without_error                                                               │
│ === RUN   TestAccGithubOrganizationSecurityConfiguration/updates_organization_security_configuration_without_error                                                               │
│ --- PASS: TestAccGithubOrganizationSecurityConfiguration (34.56s)                                                                                                                │
│     --- PASS: TestAccGithubOrganizationSecurityConfiguration/creates_organization_security_configuration_without_error (13.58s)                                                  │
│     --- PASS: TestAccGithubOrganizationSecurityConfiguration/updates_organization_security_configuration_without_error (20.99s)                                                  │
│ PASS                                                                                                                                                                             │
│ ok      github.com/integrations/terraform-provider-github/v6/github     35.017s  

This commit adds a new resource github_organization_security_configuration to manage Code Security Configurations at the organization level.
It includes:
- Resource implementation.
- Acceptance tests.
- Documentation.
- Provider registration.

Resolves integrations#2412
@github-actions github-actions bot added the Type: Feature New feature or request label Jan 30, 2026
@github-actions
Copy link

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@sprioriello sprioriello changed the title feat: Add github_organization_security_configuration resource [FEAT]: Add github_organization_security_configuration resource Jan 30, 2026
@sprioriello sprioriello changed the title [FEAT]: Add github_organization_security_configuration resource feat: Add github_organization_security_configuration resource Jan 30, 2026
Optional: true,
Default: "disabled",
Description: "The dependabot alerts configuration for the code security configuration. Can be one of 'enabled', 'disabled', 'not_set'.",
ValidateFunc: validation.StringInSlice([]string{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use ValidateDiagFunc instead in all attributes

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the feedback @deiga. I have addressed the feedback in the latest commit to move to ValidateDiagFunc

@sprioriello
Copy link
Author

Test re-run:
==> Running acceptance tests on branch: 🌿 feat/organization-security-configuration 🌿... TF_ACC=1 CGO_ENABLED=0 go test ./github/... -v -run '^TestAcc' -run='TestAccGithubOrganizationSecurityConfiguration' -timeout 120m -count=1 === RUN TestAccGithubOrganizationSecurityConfiguration === RUN TestAccGithubOrganizationSecurityConfiguration/creates_organization_security_configuration_without_error === RUN TestAccGithubOrganizationSecurityConfiguration/updates_organization_security_configuration_without_error --- PASS: TestAccGithubOrganizationSecurityConfiguration (32.00s) --- PASS: TestAccGithubOrganizationSecurityConfiguration/creates_organization_security_configuration_without_error (12.73s) --- PASS: TestAccGithubOrganizationSecurityConfiguration/updates_organization_security_configuration_without_error (19.27s) PASS ok github.com/integrations/terraform-provider-github/v6/github 32.320s

@sprioriello sprioriello changed the title feat: Add github_organization_security_configuration resource feat: Add github_organization_security_configuration and github_enterprise_security_configuration resource Feb 1, 2026
@sprioriello
Copy link
Author

Test: github_organization_security_configuration

==> Running acceptance tests on branch: 🌿 feat/organization-security-configuration 🌿...
TF_ACC=1 CGO_ENABLED=0 go test ./github/... -v -run '^TestAcc' -run='TestAccGithubOrganizationSecurityConfiguration'  -timeout 120m -count=1
=== RUN   TestAccGithubOrganizationSecurityConfiguration
=== RUN   TestAccGithubOrganizationSecurityConfiguration/creates_organization_security_configuration_without_error
=== RUN   TestAccGithubOrganizationSecurityConfiguration/updates_organization_security_configuration_without_error
=== RUN   TestAccGithubOrganizationSecurityConfiguration/creates_organization_security_configuration_with_options
--- PASS: TestAccGithubOrganizationSecurityConfiguration (42.07s)
    --- PASS: TestAccGithubOrganizationSecurityConfiguration/creates_organization_security_configuration_without_error (11.87s)
    --- PASS: TestAccGithubOrganizationSecurityConfiguration/updates_organization_security_configuration_without_error (17.71s)
    --- PASS: TestAccGithubOrganizationSecurityConfiguration/creates_organization_security_configuration_with_options (12.49s)
PASS
ok      github.com/integrations/terraform-provider-github/v6/github     42.325s

Test: github_enterprise_security_configuration

==> Running acceptance tests on branch: 🌿 feat/organization-security-configuration 🌿...
TF_ACC=1 CGO_ENABLED=0 go test ./github/... -v -run '^TestAcc' -run='TestAccGithubEnterpriseSecurityConfiguration'  -timeout 120m -count=1
=== RUN   TestAccGithubEnterpriseSecurityConfiguration
=== RUN   TestAccGithubEnterpriseSecurityConfiguration/creates_enterprise_security_configuration_without_error
=== RUN   TestAccGithubEnterpriseSecurityConfiguration/updates_enterprise_security_configuration_without_error
=== RUN   TestAccGithubEnterpriseSecurityConfiguration/creates_enterprise_security_configuration_with_options
--- PASS: TestAccGithubEnterpriseSecurityConfiguration (41.65s)
    --- PASS: TestAccGithubEnterpriseSecurityConfiguration/creates_enterprise_security_configuration_without_error (12.41s)
    --- PASS: TestAccGithubEnterpriseSecurityConfiguration/updates_enterprise_security_configuration_without_error (17.24s)
    --- PASS: TestAccGithubEnterpriseSecurityConfiguration/creates_enterprise_security_configuration_with_options (12.00s)
PASS
ok      github.com/integrations/terraform-provider-github/v6/github     41.951s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: Code Security Configuration

2 participants