Skip to content

Add archived support and github_repository_vulnerability_alerts resource to repository_base#69

Merged
bzarboni1 merged 7 commits intomainfrom
copilot/add-archived-github-vulnerability-alerts-support
Apr 28, 2026
Merged

Add archived support and github_repository_vulnerability_alerts resource to repository_base#69
bzarboni1 merged 7 commits intomainfrom
copilot/add-archived-github-vulnerability-alerts-support

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 27, 2026

GitHub has been unsetting/overriding two repository settings that Terraform wasn't explicitly managing. This PR adds explicit control over both.

Changes

archived field

  • Added archived variable (default: false) to repository_base and wired it to the github_repository resource
  • Propagated through public_repository, private_repository, internal_repository, and repository_set (as optional(bool))

github_repository_vulnerability_alerts resource

Added a dedicated github_repository_vulnerability_alerts resource controlled by the existing has_vulnerability_alerts variable:

resource "github_repository_vulnerability_alerts" "vulnerability_alerts" {
  count      = var.has_vulnerability_alerts ? 1 : 0
  repository = github_repository.repository.name
}

The has_vulnerability_alerts variable (default: true) now controls both the vulnerability_alerts attribute on the github_repository resource and whether the dedicated github_repository_vulnerability_alerts resource is created. This explicit resource prevents GitHub from silently disabling Dependabot alerts outside of Terraform's control.

Tests

Added assertions to repository_base/repository.tftest.hcl covering archived attribute correctness and github_repository_vulnerability_alerts resource creation.

Copilot AI changed the title [WIP] Add support for archived and github_repository_vulnerability_alerts Add archived support and github_repository_vulnerability_alerts resource to repository_base Apr 27, 2026
Copilot AI requested a review from bzarboni1 April 27, 2026 20:49
Copy link
Copy Markdown
Contributor

@bzarboni1 bzarboni1 left a comment

Choose a reason for hiding this comment

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

See comment to change repository.tf, then please add a conditional variable github_repository_vulnerability_alerts (True|False), with a default of false

Comment thread modules/repository_base/repository.tf
Copilot AI and others added 2 commits April 27, 2026 20:59
…t false) to control vulnerability alerts resource

Agent-Logs-Url: https://github.com/FociSolutions/github-foundations-modules/sessions/7eae243c-710f-4a41-a123-097d391f3218

Co-authored-by: bzarboni1 <99673202+bzarboni1@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 27, 2026

See comment to change repository.tf, then please add a conditional variable github_repository_vulnerability_alerts (True|False), with a default of false

Done in commit 974e341. Added github_repository_vulnerability_alerts (bool, default: false) to repository_base and propagated it through public_repository, private_repository, internal_repository, and repository_set. The resource is only created when this variable is true.

@bzarboni1 bzarboni1 marked this pull request as ready for review April 27, 2026 21:15
@bzarboni1 bzarboni1 merged commit 81febcb into main Apr 28, 2026
2 checks passed
@bzarboni1 bzarboni1 deleted the copilot/add-archived-github-vulnerability-alerts-support branch April 28, 2026 12:42
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.

[FEATURE] - Add support for archived and github_repository_vulnerability_alerts

3 participants