Repository navigation
Description
Expected Behavior
Planning the same change to an unchanged resource twice should produce the same plan, whichever installation token the provider happens to be using.
Actual Behavior
Under GitHub App auth, etag in state changes every time the provider is configured, even though the resource is untouched. GitHub's ETag for an authenticated response depends on the credentials (Vary: Accept, Authorization, Cookie), not only on the resource, and every provider configuration mints a new installation token. As @stevehipwell put it in #3103, the etag "only works with a fixed token".
CustomizeDiff keeps the value out of in-place updates, but import and destroy plans print every attribute, so two plans of the same import never match:
< etag = "W/\"e9e2bdcb4495fb6a1e2e2ff4b53ab7eb4befca326fc542a2816eff13e80ad231\""
---
> etag = "W/\"e24c7a9ef275ee40aeff68f99a212e76da368ebe38ec9325fdf47372192820ef\""
That's a github_repository import whose plan was generated in one CI job and regenerated in the apply job. Nothing touched the repository in between, but the apply refused because the plan had changed (we use dflook/terraform-apply, which compares the two plans). Every retry mints another token, so the import can never get through. We saw the same with a github_repository_ruleset being destroyed.
The org-mode acceptance tests hit this too: in run 39583616753, TestAccGithubRepository/imports_repositories_without_error, TestAccGithubRepository/can_update_forked_repository_properties and both TestAccGithubActionsRunnerGroup import tests fail with etag as the only differing attribute. Ten other tests pass ImportStateVerifyIgnore: []string{"etag"} to avoid it.
#3693 adds a reproduction, TestAccGithubRepositoryEtag. Against main at 1b9c5c1:
- With a single PAT, the etag of an unchanged repository is the same across provider configurations.
- With a GitHub App, two installation tokens see different ETags for the same repository, and the provider stores a different
etagfor it at every configuration:W/"1e9526…" != W/"b8c9b1…".
Only the legacy client reads etag back from state (etagTransport sends it as If-None-Match). The new client revalidates through its transport cache instead, so with legacy_client = false the stored value has no consumer and is only noise. One fix that keeps the schema as it is: with the new client, don't populate etag from the response, and leave the legacy client's behaviour alone. Deprecating the attribute for removal could follow separately. Happy to put the fix into #3693 if that direction works for you.
Terraform Version
Terraform v1.17.0, provider v6.13.0 and main at 1b9c5c1
GitHub Installation Type
- GitHub.com (Free, Pro, or Team)
Affected Resource(s)
Every resource that stores etag from a response, including:
- github_repository
- github_repository_ruleset
- github_actions_runner_group
Terraform Configuration Files
provider "github" {
owner = "example-org"
legacy_client = false
app_auth {} # GITHUB_APP_ID, GITHUB_APP_INSTALLATION_ID, GITHUB_APP_PEM_FILE
}
import {
to = github_repository.repo
id = "existing-repo"
}
resource "github_repository" "repo" {
name = "existing-repo"
}Steps to Reproduce
- Authenticate the provider as a GitHub App.
- Run
terraform plan -no-coloragainst a configuration that imports an existing repository, and save the output. - Run the same plan again without touching the repository.
- Compare the two outputs: only the
etagline differs.
Or run TestAccGithubRepositoryEtag from #3693 with app auth.
Debug Output
No response
Activity
github-actions commentedon Oct 22, 2026
👋 Hi, and thank you for opening this issue!
This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can.
You can help us prioritize by adding details, reproduction steps, or a 👍 to issues that matter to you, and by joining the discussion on open issues and PRs.
🤖 This is an automated message.
fix: Stop storing ETags in state with the new client
stevehipwell commentedon Oct 23, 2026
@benlangfeld I agree that this behaviour sucks, but it's been like this forever. I'm expecting to remove it in the next major version along with the legacy client, but to do that we need to get the changes required completed, released and tested.
Could you elaborate on why you think this needs prioritising and the impact it has?
benlangfeld commentedon Oct 23, 2026
This impacts the new client, not only the legacy one. When using https://github.com/dflook/terraform-github-actions, this causes the pipeline to get completely blocked on trivial changes. Precisely for the reason that this has been broken forever, I opened a PR to fix it.
stevehipwell commentedon Oct 23, 2026
@benlangfeld I've been making this point for a while. I'm happy to review a low cost PR to fix this for the new client only. I just want something I can easily review which has the absolute least added complexity as I wand to get rid of the legacy client and in resource etags ASAP.
So from your previous PR we only need a
storeEtagproperty on theOwnerstruct wired up (initially) to when the new client is not being used, and anif meta.storeEtagcondition in the resources to check if the etag should be set (no wrapping function); the rest of the code should work correctly. The tests could be updated to remove etag ignores but no changes should be required as they always use the new client.fix: Stop storing ETags in state with the new client
fix: Stop storing ETags in state with the new client (integrations#3693)