You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: Changes made to repository's Github Pages configuration outside Terraform are not detected on terraform refresh #1913
If a github_repository resource has the pages block configured and deployed, but then the repository's Github Pages configuration is subsequently changed outside of Terraform, the Github Terraform provider should detect those changes on the next terraform plan/terraform apply/terraform refresh and update the underlying resource's configuration to what's reflected in the Terraform template.
Actual Behavior
If changes to a repository's Pages configuration are made outside Terraform those changes are not detected in the next terraform plan/terraform apply/terraform refresh and instead shows the following output:
No changes. Your infrastructure matches the configuration.
Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.
Following from this bug, removing the pages config block on a github_repository resource that has already had pages disabled in the Github console (ie outside of terraform) results in a 404 upon the next terraform apply and thus a broken Terraform template/state:
Terraform will perform the following actions:
# github_repository.main will be updated in-place
~ resource "github_repository" "main" {
id = "test-repo"
name = "test-repo"
# (34 unchanged attributes hidden)
- pages {
- build_type = "legacy" -> null
- custom_404 = false -> null
- html_url = "https://redacted.pages.github.io/" -> null
- status = "building" -> null
- url = "https://api.github.com/repos/redacted/test-repo/pages" -> null
- source {
- branch = "main" -> null
- path = "/docs" -> null
}
}
# (1 unchanged block hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
github_repository.main: Modifying... [id=test-repo]
│ Error: DELETE https://api.github.com/repos/redacted/test-repo/pages: 404 Not Found []
│
│ with github_repository.main,
│ on main.tf line 1, in resource "github_repository" "main":
│ 1: resource "github_repository" "main" {
│
╵
Releasing state lock. This may take a few moments...
I assume this error occurs because the resource's update method doesn't handle the 404 response.
I'm running into the same issue regarding Terraform not detecting changes made to GitHub Pages.
Also, I am not sure why GitHub Pages is managed as a nested block instead of being a standalone resource, they are separate endpoints in the REST API and are controlled by separate permissions.
They definitely should be separate resources; see #1617 for a draft attempt at splitting them. It hasn't changed yet mostly due to inertia and the severity of the breaking change.
👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!
Hi, Any update on this. Because in our scenario we are also facing this issue like manually we did the changes on github-pages (changed folder/branch) but during the terraform plan/apply it couldn't found the drift changes between the current state with desired state. We are looking for a solution. Any of them found the solution means please update here.
Activity
calebworks commentedon Sep 21, 2023
Following from this bug, removing the
pagesconfig block on agithub_repositoryresource that has already had pages disabled in the Github console (ie outside of terraform) results in a 404 upon the nextterraform applyand thus a broken Terraform template/state:I assume this error occurs because the resource's update method doesn't handle the 404 response.
laurenty commentedon Jan 23, 2024
I'm running into the same issue regarding Terraform not detecting changes made to GitHub Pages.
Also, I am not sure why GitHub Pages is managed as a nested block instead of being a standalone resource, they are separate endpoints in the REST API and are controlled by separate permissions.
kfcampbell commentedon Jan 23, 2024
They definitely should be separate resources; see #1617 for a draft attempt at splitting them. It hasn't changed yet mostly due to inertia and the severity of the breaking change.
github-actions commentedon Oct 20, 2024
👋 Hey Friends, this issue has been automatically marked as
stalebecause it has no recent activity. It will be closed if no further activity occurs. Please add theStatus: Pinnedlabel if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!ramprakashpower commentedon Sep 21, 2025
Hi, Any update on this. Because in our scenario we are also facing this issue like manually we did the changes on github-pages (changed folder/branch) but during the terraform plan/apply it couldn't found the drift changes between the current state with desired state. We are looking for a solution. Any of them found the solution means please update here.
heclemen commentedon Feb 6, 2026
we bumped into this issue after updating from 6.5.0 to 6.11.0 (tested also with 6.8 / 6.9 / 6.10)
doesn't get updated, always shows on the terraform plan