Skip to content

[BUG]: Conflict between GITHUB_TOKEN and app_auth {} #3096

Closed

Description

@thomvaill

Expected Behavior

When I have this config:

provider "github" {
  token = ""
  app_auth {}
}

... and these environment variables set: GITHUB_TOKEN, GITHUB_APP_*
The Github App auth should work.

We have this case because in our CI we need GITHUB_TOKEN to be set for another tool (in our case Terramate), but we want to use a Github App authentication for the Github provider.

Actual Behavior

  ╷
  │ Error: Conflicting configuration arguments
  │ 
  │   with provider["registry.opentofu.org/integrations/github"],
  │   on provider-github.tf line 2, in provider "github":
  │    2: provider "github" {
  │ 
  │ "app_auth": conflicts with token
  ╵
  ╷
  │ Error: Conflicting configuration arguments
  │ 
  │   with provider["registry.opentofu.org/integrations/github"],
  │   on provider-github.tf line 5, in provider "github":
  │    5:   token = ""
  │ 
  │ "token": conflicts with app_auth

It happens since v6.10.0, since #3071 was merged.

Terraform Version

OpenTofu v1.10.6

Affected Resource(s)

Authentication

Terraform Configuration Files

Steps to Reproduce

No response

Debug Output

Panic Output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    Type: Bug
    Status: Triage
    on Jan 20, 2026
  2. github-actions commented on Jan 20, 2026

    @github-actions

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

  3. stevehipwell commented on Jan 20, 2026

    @stevehipwell
    Collaborator

    @thomvaill are you attempting to override the auth mode at runtime?

  4. stevehipwell commented on Jan 20, 2026

    @stevehipwell
    Collaborator

    @thomvaill you should be able to change your provider config to make this work as the configuration below is semantically identical.

    provider "github" {
      app_auth {}
    }
  5. thomvaill commented on Jan 20, 2026

    @thomvaill
    Author

    @thomvaill you should be able to change your provider config to make this work as the configuration below is semantically identical.

    provider "github" {
    app_auth {}
    }

    Before the merge of #3071 we had this config and it worked well. But since this PR was merged, we get the "token": conflicts with app_auth because the GITHUB_TOKEN env var is defined

  6. stevehipwell commented on Jan 20, 2026

    @stevehipwell
    Collaborator

    @deiga I think the change in #3071 was actually breaking. We may need to revert (until v7) it in favour of a custom validation function that errors if the token length >0 and the app_auth length >0.

  7. stevehipwell commented on Jan 20, 2026

    @stevehipwell
    Collaborator

    @thomvaill your configuration is actually invalid because you set token = "". If you have GITHUB_TOKEN defined then it will also error once that is removed until we fix the primary defect here. See above for my comment about your specific use case.

  8. removed
    Status: Triage
    on Jan 20, 2026
  9. added this to the v6.10.2 Release milestone on Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: Bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions