Repository navigation
Labels
Type: BugSomething isn't working as documented
Milestone
Description
Expected Behavior
Applying the Terraform plan for a new github_repository with vulnerability_alerts = true should create the repository without producing an error.
This is running in an GitHub Enterprise Cloud account.
It works fine with provider version 6.6.0 but fails with 6.7.0 to 6.9.0 (error below).
Possibly related to #2501.
Actual Behavior
Terraform errors, creates the repository but the state is broken with some attributes missing. Just applying Terraform again does not fix the issues.
Error: DELETE https://api.github.com/repos/lessonnine/jts-test.test/vulnerability-alerts: 422 An enforced security configuration prevented modifying dependabot alerts enablement. Contact your organization owner for details. []
│
│ with github_repository.lessonnine-jts-test-test,
│ on generated.tf line 50028, in resource "github_repository" "lessonnine-jts-test-test":
│ 50028: resource "github_repository" "lessonnine-jts-test-test" {
Terraform Version
Terraform version 1.11.4 on linux_amd64.
Affected Resource(s)
github_repository
Terraform Configuration Files
resource "github_repository" "lessonnine-jts-test-test" {
name = "jts-test.test"
description = "Just for testing GitHub api (Infrastructure)"
topics = [
"infrastructure",
]
has_issues = false
has_projects = true
has_wiki = false
allow_rebase_merge = false
allow_squash_merge = false
visibility = "private"
vulnerability_alerts = true # test adding this attribute
auto_init = true
delete_branch_on_merge = true
allow_update_branch = true
allow_auto_merge = true
lifecycle {
prevent_destroy = true
ignore_changes = [
# vulnerability alerts are managed via org-wide settings
vulnerability_alerts,
]
}
}
with provider version:
github = {
source = "integrations/github"
version = "6.7.0"
}Steps to Reproduce
$ terraform apply
Debug Output
Error: DELETE https://api.github.com/repos/lessonnine/jts-test.test/vulnerability-alerts: 422 An enforced security configuration prevented modifying dependabot alerts enablement. Contact your organization owner for details. []
│
│ with github_repository.lessonnine-jts-test-test,
│ on generated.tf line 50028, in resource "github_repository" "lessonnine-jts-test-test":
│ 50028: resource "github_repository" "lessonnine-jts-test-test" {Panic Output
noneCode of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
Type: BugSomething isn't working as documented
Activity
github-actions commentedon Dec 9, 2025
👋 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! 🚀stevehipwell commentedon Dec 9, 2025
@jtsaito are you explicitly setting the value on a repo in an organization where this is being managed by the organization? If you don't set it on the repo is it working?
mark-oppenheim commentedon Dec 10, 2025
I'm seeing the same issue on 6.8.3, whether I explicity set
vulnerability_alertstotrue,nullor rely on the default.stevehipwell commentedon Dec 11, 2025
@mark-oppenheim the current implementation always calls one of the vulnerability alert endpoints. AFAIK this has been the case for a long time.
mark-oppenheim commentedon Dec 19, 2025
That makes sense, but what I'm seeing is errors for all values of
vulnerability_alertsunless I tie the provider version to< 6.7.stevehipwell commentedon Dec 20, 2025
@mark-oppenheim just to confirm that this is a regression since v6.7.0 with the same GitHub settings?
tobias-jenkner commentedon Jan 12, 2026
Repo creation still fails with version 6.9.1 in my case with the following error message:
Error: DELETE https://github.domain.de/api/v3/repos/ORG/REPO/vulnerability-alerts: 422 Failed to change dependabot alerts status.stevehipwell commentedon Jan 12, 2026
@tobias-jenkner could you provide a bit more context?
tobias-jenkner commentedon Jan 12, 2026
Terraform Enterprise using Terraform v1.12.2
GitHub Enterprise 3.17
Unfortunately, I cannot share my TF code - I would need to create a separate reproduction example - I can do that during the next days, if it is needed.
stevehipwell commentedon Jan 12, 2026
@tobias-jenkner if you could create a reproduction and open a new issue with it that'd be great and would allow us to focus on your specific issue which may be subtly different to.
FYI we'd expect a 422 error if you were attempting to do something that couldn't be supported by GitHub (such as explicitly setting the vulnerability alerts value on a repo in an org which is managing this centrally).
3 remaining items
stevehipwell commentedon Jan 12, 2026
@tobias-jenkner I'd say that's still a defect as it should be able to work without a value set so worth opening up a new issue.
deiga commentedon Jan 12, 2026
Apparently GHES has different error messages for validation errors 😬
stevehipwell commentedon Jan 12, 2026
That was one of our concerns about checking error strings.
deiga commentedon Jan 12, 2026
I know that. I really should get the new resource done. Maybe we can get it into 6.10.0 already
jtsaito commentedon Jan 23, 2026
I deeply apologize, the updates escaped my attention.
Yes, I'm setting the attribute in on create in the repository.
The error persist in recent provider versions and we remain pinned down to
v6.6.0. Forv6.6.0repositories can be created without errors as before.My organization's "Global Advanced Security settings" show
with "GitHub presets"
@stevehipwell Again, my apologies for my late reply. Please let me know if I should open a separate issue or this one can be re-opened.
stevehipwell commentedon Jan 23, 2026
@jtsaito this statement is incorrect, if vulnerability alerts are being managed at the org level you can't set the value either way. Could you confirm that you have an issue even when you're not explicitly setting
vulnerability_alerts(I suspect that you are).@deiga this is similar to the
allow_forkingissue, we should only hit the endpoint for vulnerability alerts if a value has been explicitly set (and not at all in the next major version).deiga commentedon Jan 23, 2026
Yeah, I agree. Although that will be a silent change in behaviour, since the default (depending on context) will change
stevehipwell commentedon Jan 23, 2026
@deiga technically the behaviour may change, but the current behavior is undefined and it will only be for new repos. I'm working on a PR to fix this behaviour.
jtsaito commentedon Jan 23, 2026
@deiga @stevehipwell Thank you so much for re-opening the issue.
Currently, our Terraform state for managing repos is blocked so I cannot test. I'll get back to you on Monday at latest.
jtsaito commentedon Jan 23, 2026
@stevehipwell Yes, I can confirm that I have an issue even when I'm not explicitely setting
vulnerability_alerts.I ran the Terraform apply without setting the
vulnerability_alertsas follows.This still resulted in the following error.
jtsaito commentedon Feb 9, 2026
@stevehipwell Thank you so much! I can confirm this has solved our issue.