Skip to content

Examples using atlantis_repo_allowlist output don't work #253

@bodgit

Description

@bodgit

Description

Since #221 was merged, the examples of using the atlantis_repo_allowlist output as an input to the GitHub webhook submodule don't work. Consider the following stripped down example:

module "atlantis" {
  ...
  atlantis_repo_allowlist = ["github.com/someuser/*"]
  ...
}

module "github_repository_webhook" {
  ...
  atlantis_repo_allowlist = module.atlantis.atlantis_repo_allowlist
  ...
}

This code is basically what is in the complete GitHub example in this repo. However, it generates this error:

╷
│ Error: POST https://api.github.com/repos/someuser/github.com/someuser/*/hooks: 404 Not Found []
│ 
│   with module.github_repository_webhook.github_repository_webhook.this[0],
│   on .terraform/modules/github_repository_webhook/modules/github-repository-webhook/main.tf line 7, in resource "github_repository_webhook" "this":
│    7: resource "github_repository_webhook" "this" {
│ 
╵

Initially I thought it was just the wildcard causing the problem, but it's passing in the whole "github.com/.../..." string. You need to pass the short repository name, which will be owned by the account that owns the credentials configured in the GitHub provider.

This used to work as it was using the atlantis_allowed_repo_names variable which would've been configured like ["repo1", "repo2"], etc.

IMHO, removing an input parameter from the module should've been a major version bump here as it breaks backwards compatibility.

Versions

  • Terraform: 1.1.3
  • Provider(s): aws 3.74.2
  • Module: 3.9.0+

Reproduction

See above.

Code Snippet to Reproduce

See above.

Expected behavior

Webhook should be created.

Actual behavior

GitHub API error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions