Skip to content

[FEAT] Add new resource for repository vulnerability alerts - #3166

Merged
stevehipwell merged 16 commits into
integrations:mainfrom
F-Secure-web:add-github_repository_vulnerability_alerts
Apr 16, 2026
Merged

stevehipwell merged 16 commits into
integrations:mainfrom
F-Secure-web:add-github_repository_vulnerability_alerts

Conversation

@deiga

@deiga deiga commented Feb 8, 2026

Copy link
Copy Markdown
Collaborator

Resolves #3038


Before the change?

  • Vulnerability alerts for a repository were handled inside the github_repository resource.

After the change?

  • Vulnerability alerts for a repository can now be managed in a separate resource
  • vulnerability_alerts in the github_repository resource are marked as deprecated

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

@deiga
deiga requested a review from stevehipwell February 8, 2026 11:38
@github-actions

github-actions Bot commented Feb 8, 2026

Copy link
Copy Markdown

👋 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! 🚀

@deiga
deiga force-pushed the add-github_repository_vulnerability_alerts branch 2 times, most recently from fb54b9b to 5b5d40c Compare February 13, 2026 22:57

@stevehipwell stevehipwell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is looking good.

@deiga
deiga force-pushed the add-github_repository_vulnerability_alerts branch from 5b5d40c to 8ba3a26 Compare February 16, 2026 21:13
@deiga
deiga requested a review from stevehipwell February 16, 2026 21:13
@deiga
deiga force-pushed the add-github_repository_vulnerability_alerts branch from 8ba3a26 to 7ea9d1a Compare February 17, 2026 20:34
@deiga
deiga requested a review from stevehipwell February 17, 2026 20:34
@stevehipwell

Copy link
Copy Markdown
Collaborator

@deiga could you please rebase?

@deiga
deiga force-pushed the add-github_repository_vulnerability_alerts branch from 7ea9d1a to 9791700 Compare February 21, 2026 14:10
@deiga
deiga requested a review from stevehipwell February 21, 2026 14:10

@stevehipwell stevehipwell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks good, just two minor nits which I think are worth fixing for readability and because I think this resource will be one we can use as an example for people contributing.

@deiga
deiga force-pushed the add-github_repository_vulnerability_alerts branch from 9791700 to 4f3c392 Compare February 23, 2026 18:51
@deiga
deiga requested a review from stevehipwell February 23, 2026 18:51

@stevehipwell stevehipwell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This PR looks great, I just have a concern about string matching on an error message (we know errors aren't consistent across GHAS), especially one that isn't explicit about the cause. If we think it's valuable to provide a custom error message, which I'm personally not sure about, then we ought to use the API to get a definitive answer.

@deiga
deiga requested a review from stevehipwell February 24, 2026 19:19
stevehipwell
stevehipwell previously approved these changes Mar 2, 2026

@stevehipwell stevehipwell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@stevehipwell stevehipwell added this to the v6.12.0 Release milestone Mar 2, 2026
@deiga
deiga force-pushed the add-github_repository_vulnerability_alerts branch from c41ad75 to cb0ee23 Compare March 30, 2026 19:27
@deiga
deiga requested a review from stevehipwell April 14, 2026 19:37
@deiga deiga added the acctest For CI / automated testing label Apr 14, 2026
@deiga
deiga deployed to acctest-dotcom April 14, 2026 19:38 — with GitHub Actions Active
@stevehipwell stevehipwell removed the acctest For CI / automated testing label Apr 16, 2026

@stevehipwell stevehipwell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@stevehipwell
stevehipwell merged commit 72681b4 into integrations:main Apr 16, 2026
9 of 15 checks passed
@deiga
deiga deleted the add-github_repository_vulnerability_alerts branch April 16, 2026 18:20
JiayangZhou pushed a commit to JiayangZhou/terraform-provider-github that referenced this pull request Apr 16, 2026
…ions#3166)

* Add resource for repository vulnerability alerts

Signed-off-by: Timo Sand <[email protected]>

* Mark `vulnerability_alerts` in `github_repository` as deprecated

Signed-off-by: Timo Sand <[email protected]>

* Update formatting

Signed-off-by: Timo Sand <[email protected]>

* Update import after rebase

Signed-off-by: Timo Sand <[email protected]>

* Correct file names

Signed-off-by: Timo Sand <[email protected]>

* Address review comments

Signed-off-by: Timo Sand <[email protected]>

* Simplify `SetId`

Signed-off-by: Timo Sand <[email protected]>

* Comment out `owner` until we can support it better

Signed-off-by: Timo Sand <[email protected]>

* Refactor to use `ConfigStateChecks`

Signed-off-by: Timo Sand <[email protected]>

* Update import ID to only repository name

Signed-off-by: Timo Sand <[email protected]>

* Improves tests

Signed-off-by: Timo Sand <[email protected]>

* Updates docs

Signed-off-by: Timo Sand <[email protected]>

* Add clearer error for user when trying to add to an archived repository

Signed-off-by: Timo Sand <[email protected]>

* Re-order `SetId`

Signed-off-by: Timo Sand <[email protected]>

* Simplify archived repo handling

Signed-off-by: Timo Sand <[email protected]>

* Fix behaviour on archived repository

Signed-off-by: Timo Sand <[email protected]>

---------

Signed-off-by: Timo Sand <[email protected]>
JamBalaya56562 added a commit to aletheia-works/vivarium that referenced this pull request Apr 19, 2026
Declares the Pages configuration on the vivarium repository via the
provider's nested `pages` block with `build_type = "workflow"`. The
actual build/deploy is still driven by `.github/workflows/deploy-docs.yml`
(`actions/configure-pages` + `actions/deploy-pages`); putting the
enablement itself under IaC means drift (e.g. a UI toggle disabling the
site) is detectable on the next `tofu plan` rather than silently
breaking the deploy.

Required a tweak to `lifecycle.ignore_changes`. The previous `all` was
a broad guard against the signoff-bug-induced PATCH 422 (`integrations/
github` v6.x hardcodes `web_commit_signoff_required=false`), but that
also blanket-ignored the `pages` block. Switched to an explicit per-
attribute list that covers every existing repo attr *except* `pages`.
The provider reaches Pages via a separate `/pages` API call, so it is
unaffected by the broken repo PATCH. Revert to
`ignore_changes = [web_commit_signoff_required]` once v6.12+ ships
(integrations/terraform-provider-github#3166).

Org-level prerequisite (`members_can_create_public_pages = true`) was
landed earlier in aletheia-works/.github.
JamBalaya56562 added a commit to aletheia-works/vivarium that referenced this pull request Apr 19, 2026
Declares the Pages configuration on the vivarium repository via the
provider's nested `pages` block with `build_type = "workflow"`. The
actual build/deploy is still driven by `.github/workflows/deploy-docs.yml`
(`actions/configure-pages` + `actions/deploy-pages`); putting the
enablement itself under IaC means drift (e.g. a UI toggle disabling the
site) is detectable on the next `tofu plan` rather than silently
breaking the deploy.

Required a tweak to `lifecycle.ignore_changes`. The previous `all` was
a broad guard against the signoff-bug-induced PATCH 422 (`integrations/
github` v6.x hardcodes `web_commit_signoff_required=false`), but that
also blanket-ignored the `pages` block. Switched to an explicit per-
attribute list that covers every existing repo attr *except* `pages`.
The provider reaches Pages via a separate `/pages` API call, so it is
unaffected by the broken repo PATCH. Revert to
`ignore_changes = [web_commit_signoff_required]` once v6.12+ ships
(integrations/terraform-provider-github#3166).

Org-level prerequisite (`members_can_create_public_pages = true`) was
landed earlier in aletheia-works/.github.
JamBalaya56562 added a commit to aletheia-works/vivarium that referenced this pull request Apr 19, 2026
Declares the Pages configuration on the vivarium repository via the
provider's nested `pages` block with `build_type = "workflow"`. The
actual build/deploy is still driven by `.github/workflows/deploy-docs.yml`
(`actions/configure-pages` + `actions/deploy-pages`); putting the
enablement itself under IaC means drift (e.g. a UI toggle disabling the
site) is detectable on the next `tofu plan` rather than silently
breaking the deploy.

Required a tweak to `lifecycle.ignore_changes`. The previous `all` was
a broad guard against the signoff-bug-induced PATCH 422 (`integrations/
github` v6.x hardcodes `web_commit_signoff_required=false`), but that
also blanket-ignored the `pages` block. Switched to an explicit per-
attribute list that covers every existing repo attr *except* `pages`.
The provider reaches Pages via a separate `/pages` API call, so it is
unaffected by the broken repo PATCH. Revert to
`ignore_changes = [web_commit_signoff_required]` once v6.12+ ships
(integrations/terraform-provider-github#3166).

Org-level prerequisite (`members_can_create_public_pages = true`) was
landed earlier in aletheia-works/.github.
mkushakov pushed a commit to mkushakov/terraform-provider-github that referenced this pull request Apr 27, 2026
…ions#3166)

* Add resource for repository vulnerability alerts

Signed-off-by: Timo Sand <[email protected]>

* Mark `vulnerability_alerts` in `github_repository` as deprecated

Signed-off-by: Timo Sand <[email protected]>

* Update formatting

Signed-off-by: Timo Sand <[email protected]>

* Update import after rebase

Signed-off-by: Timo Sand <[email protected]>

* Correct file names

Signed-off-by: Timo Sand <[email protected]>

* Address review comments

Signed-off-by: Timo Sand <[email protected]>

* Simplify `SetId`

Signed-off-by: Timo Sand <[email protected]>

* Comment out `owner` until we can support it better

Signed-off-by: Timo Sand <[email protected]>

* Refactor to use `ConfigStateChecks`

Signed-off-by: Timo Sand <[email protected]>

* Update import ID to only repository name

Signed-off-by: Timo Sand <[email protected]>

* Improves tests

Signed-off-by: Timo Sand <[email protected]>

* Updates docs

Signed-off-by: Timo Sand <[email protected]>

* Add clearer error for user when trying to add to an archived repository

Signed-off-by: Timo Sand <[email protected]>

* Re-order `SetId`

Signed-off-by: Timo Sand <[email protected]>

* Simplify archived repo handling

Signed-off-by: Timo Sand <[email protected]>

* Fix behaviour on archived repository

Signed-off-by: Timo Sand <[email protected]>

---------

Signed-off-by: Timo Sand <[email protected]>
austenstone pushed a commit to austenstone/terraform-provider-github that referenced this pull request Jun 9, 2026
…ions#3166)

* Add resource for repository vulnerability alerts

Signed-off-by: Timo Sand <[email protected]>

* Mark `vulnerability_alerts` in `github_repository` as deprecated

Signed-off-by: Timo Sand <[email protected]>

* Update formatting

Signed-off-by: Timo Sand <[email protected]>

* Update import after rebase

Signed-off-by: Timo Sand <[email protected]>

* Correct file names

Signed-off-by: Timo Sand <[email protected]>

* Address review comments

Signed-off-by: Timo Sand <[email protected]>

* Simplify `SetId`

Signed-off-by: Timo Sand <[email protected]>

* Comment out `owner` until we can support it better

Signed-off-by: Timo Sand <[email protected]>

* Refactor to use `ConfigStateChecks`

Signed-off-by: Timo Sand <[email protected]>

* Update import ID to only repository name

Signed-off-by: Timo Sand <[email protected]>

* Improves tests

Signed-off-by: Timo Sand <[email protected]>

* Updates docs

Signed-off-by: Timo Sand <[email protected]>

* Add clearer error for user when trying to add to an archived repository

Signed-off-by: Timo Sand <[email protected]>

* Re-order `SetId`

Signed-off-by: Timo Sand <[email protected]>

* Simplify archived repo handling

Signed-off-by: Timo Sand <[email protected]>

* Fix behaviour on archived repository

Signed-off-by: Timo Sand <[email protected]>

---------

Signed-off-by: Timo Sand <[email protected]>
austenstone pushed a commit to austenstone/terraform-provider-github that referenced this pull request Jun 9, 2026
…ions#3166)

* Add resource for repository vulnerability alerts

Signed-off-by: Timo Sand <[email protected]>

* Mark `vulnerability_alerts` in `github_repository` as deprecated

Signed-off-by: Timo Sand <[email protected]>

* Update formatting

Signed-off-by: Timo Sand <[email protected]>

* Update import after rebase

Signed-off-by: Timo Sand <[email protected]>

* Correct file names

Signed-off-by: Timo Sand <[email protected]>

* Address review comments

Signed-off-by: Timo Sand <[email protected]>

* Simplify `SetId`

Signed-off-by: Timo Sand <[email protected]>

* Comment out `owner` until we can support it better

Signed-off-by: Timo Sand <[email protected]>

* Refactor to use `ConfigStateChecks`

Signed-off-by: Timo Sand <[email protected]>

* Update import ID to only repository name

Signed-off-by: Timo Sand <[email protected]>

* Improves tests

Signed-off-by: Timo Sand <[email protected]>

* Updates docs

Signed-off-by: Timo Sand <[email protected]>

* Add clearer error for user when trying to add to an archived repository

Signed-off-by: Timo Sand <[email protected]>

* Re-order `SetId`

Signed-off-by: Timo Sand <[email protected]>

* Simplify archived repo handling

Signed-off-by: Timo Sand <[email protected]>

* Fix behaviour on archived repository

Signed-off-by: Timo Sand <[email protected]>

---------

Signed-off-by: Timo Sand <[email protected]>
RazvanBerbece added a commit to Unify-Solutions/github-manager that referenced this pull request Oct 23, 2026
…ction, delete `UnifyTickerTool` and `UnifyFootball-Infrastructure` (#10)

* chore(deps): ⬆️ GitHub Actions to their latest stable releases

- actions/checkout v6 -> v7.0.1
- hashicorp/setup-terraform v4 -> v4.0.1
- actions/github-script v8 -> v9.0.0

Pins move to full vX.Y.Z tags. None of the inputs these workflows use changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(deps): ⬆️ mathieudutour/github-tag-action v6.2 -> v7.0.0

v7 no longer calculates a version when no eligible commit exists since the last
tag (for example a workflow_dispatch re-run on an already released main), so
`new_tag` can now be empty. The migration guide asks downstream steps to guard on
it, so the GitHub release step only runs when a tag was calculated.

The other v7 changes do not affect this workflow: `default_bump: major` stays the
fallback, `main` is still a release branch, and `dry_run: true` keeps tagging to
ncipollo/release-action.

Migration guide: https://github.com/mathieudutour/github-tag-action/blob/v7.0.0/docs/migrating-to-v7.md

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(deps): ⬆️ integrations/github provider 6.11.1 -> 6.13.0

The committed lock file still pinned 6.2.2 (CI's `terraform init -upgrade` has
been papering over it), so it is regenerated for 6.13.0 with hashes for
linux_amd64 (CI, HCP Terraform runs), darwin_amd64 and darwin_arm64.

Release notes:
- https://github.com/integrations/terraform-provider-github/releases/tag/v6.12.0
- https://github.com/integrations/terraform-provider-github/releases/tag/v6.12.1
- https://github.com/integrations/terraform-provider-github/releases/tag/v6.13.0

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: 🛡️ manage vulnerability alerts with github_repository_vulnerability_alerts

`vulnerability_alerts` on `github_repository` is deprecated since provider 6.12.0
and will be removed in a future version. Each managed repository now gets a
`github_repository_vulnerability_alerts` resource driven by the same
`enable_vulnerability_alerts` flag.

- The repository attribute is Optional + Computed, so dropping it from the
  config causes no diff on the existing repositories.
- The new resources are created on the next apply. Creating one calls the same
  enable endpoint the attribute used, so the live setting does not change.
- Dependabot security updates now depend on the alerts resource: GitHub only
  enables them when Dependabot alerts are on, and both resources would otherwise
  be created in parallel for a new repository.

Docs: https://registry.terraform.io/providers/integrations/github/6.13.0/docs/resources/repository_vulnerability_alerts
Provider PR: integrations/terraform-provider-github#3166

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* repo: 🗑️ delete `UnifyTickerTool`

Removes the repository from the managed list. The next apply destroys
`github_repository.managed_repositories["UnifyTickerTool"]` (no
`archive_on_destroy`, so GitHub deletes it) together with its collaborators and
Dependabot security updates resources.

The repository holds only the BaseTemplate initial commit (created and last
pushed 2025-10-31).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: 🔐 declare secret scanning push protection on repositories with secret scanning

GitHub keeps push protection enabled on the public BaseTemplate, but the config
only declared `secret_scanning`, so every plan since at least 2026-03-23 tried to
set `secret_scanning_push_protection` back to null. Repositories with
`enable_secret_scanning = "enabled"` now declare push protection as enabled too,
which matches the live setting and ends the perpetual in-place update.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* repo: 🗑️ delete `UnifyFootball-Infrastructure`

Removes the repository from the managed list. The next apply destroys
`github_repository.managed_repositories["UnifyFootball-Infrastructure"]` (no
`archive_on_destroy`, so GitHub deletes it) together with its collaborators and
Dependabot security updates resources. Its vulnerability alerts resource is
never created, as it leaves the list in the same change.

The repository holds only the initial commit (created and last pushed
2024-09-05); the UnifyFootball infrastructure lives in UnifyFootball's own
`infrastructure/` folder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch had an error being deployed

1 failed deployment
acctest-dotcom — 3d0fd90f Deployed Apr 16, 2026 by deiga via Test individual #1319
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MAINT]: Add a new resource for github_repository_vulnerability_alerts

3 participants