Skip to content

[BUG]: data github_repository_environments 403 Resource not accessible by integration [] #3121

Closed

Description

@JelleBroekhuijsen

Expected Behavior

  • Data source returns information on environments in repository.

Actual Behavior

  • Throws: Error: GET https://api.github.com/repos/<myUser>/<myRepo>/environments: 403 Resource not accessible by integration []

Terraform Version

Terraform v1.7.0
on linux_amd64

  • provider registry.terraform.io/integrations/github v6.10.2

Affected Resource(s)

Data source:"

  • github_repository_environments

Terraform Configuration Files

locals {
  repository_name = "../${var.github_owner}/${var.repo_name}"
}

data "github_repository_environments" "this" {
  repository = local.repository_name
}

Steps to Reproduce

terraform plan

Debug Output

odule.entra_application.data.github_repository_environments.bill_of_materials: Reading...
module.entra_application.data.azuread_client_config.current: Reading...
module.entra_application.data.azuread_client_config.current: Read complete after 0s [id=***-***-db5c98c3-32af-4e0d-8776-745019d621d7]
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
Terraform planned the following actions, but then encountered a problem:
  # module.entra_application.azuread_application.this will be created
  + resource "azuread_application" "this" {
      + app_role_ids                = (known after apply)
      + client_id                   = (known after apply)
      + disabled_by_microsoft       = (known after apply)
      + display_name                = "bill-of-materials-test-app"
      + id                          = (known after apply)
      + logo_url                    = (known after apply)
      + oauth2_permission_scope_ids = (known after apply)
      + object_id                   = (known after apply)
      + owners                      = [
          + "db5c98c3-32af-4e0d-8776-745019d621d7",
        ]
      + prevent_duplicate_names     = false
      + publisher_domain            = (known after apply)
      + sign_in_audience            = "AzureADMultipleOrgs"
      + tags                        = (known after apply)
      + template_id                 = (known after apply)
    }
Plan: 1 to add, 0 to change, 0 to destroy.
Error: GET https://api.github.com/repos/<myUser>/<myRepo>/environments: 403 Resource not accessible by integration []
  with module.entra_application.data.github_repository_environments.bill_of_materials,
  on ../modules/entra_application/data.tf line 1, in data "github_repository_environments" "bill_of_materials":
   1: data "github_repository_environments" "bill_of_materials" {

Panic Output

Code of Conduct

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

Activity

  1. added
    Type: Bug
    Status: Triage
    on Jan 26, 2026
  2. github-actions commented on Jan 26, 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. deiga commented on Jan 26, 2026

    @deiga
    Collaborator

    Hi @JelleBroekhuijsen

    • Could you provider more details about how you authenticate the provider?
    • I see that you are using a module, are you explicitly setting the required_providers inside the module?
  4. JelleBroekhuijsen commented on Feb 4, 2026

    @JelleBroekhuijsen
    Author
    • App authentication using private key/app id/installation id
    • Yes, the required_providers config is present in my module
    • I also reproduced this when working without a module

    Provider config for the stand alone config:

    terraform {
      required_version = ">= 1.7.0"
    
      required_providers {
        github = {
          source  = "integrations/github"
          version = "6.10.2"
        }
      }
    }
    
    provider "github" {
      owner = var.github_owner
      app_auth {
        id              = var.github_app_id
        installation_id = var.github_app_installation_id
        pem_file        = var.github_app_pem_file
      }
    }
    
  5. deiga commented on Feb 4, 2026

    @deiga
    Collaborator

    Thanks for those details, can you list which permissions the app has?

  6. JelleBroekhuijsen commented on Feb 10, 2026

    @JelleBroekhuijsen
    Author

    Repository:

    • Administration: Read/write
    • Contents: Read/Write
    • Environments: Read/Write
    • Secrets: Read/Write
    • Variables: Read/Write
  7. deiga commented on Feb 12, 2026

    @deiga
    Collaborator

    A quick look in the docs shows me:

    The fine-grained token must have the following permission set:
    "Actions" repository permissions (read)

    @JelleBroekhuijsen Could you test if adding that addresses the issue?

  8. patrickvinograd commented on Mar 11, 2026

    @patrickvinograd

    I ran into this same error and adding the Actions permission to the Github App solved the problem for github_repository_environments.

  9. jakub-trzebiatowski commented on Jul 17, 2026

    @jakub-trzebiatowski

    It doesn't make much sense, but yes, I confirm that the adding Actions permission helps with being unable to access https://api.github.com/repos/medusa-software-hq/flow/environments/<name>.

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

    Awaiting responseStatus: TriageType: Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions