Skip to content

[BUG]: autolink allows numbers during plan, but fails during apply #3176

@MarkVaughn

Description

@MarkVaughn

Expected Behavior

Plan should have failed with bad key_prefix, but passed

Actual Behavior

Plan echoed successful diff

+ resource "github_repository_autolink_reference" "all" {
+       etag                = (known after apply)
+       id                  = (known after apply)
+       is_alphanumeric     = false
+       key_prefix          = "PTFY25"
+       repository          = "apiv2"
+       target_url_template = "https://***.atlassian.net/browse/PTFY25-<num>"

But during apply

Error: POST https://api.github.com/repos/****/apiv2/autolinks: 422 Validation Failed [{Resource:KeyLink Field:key_prefix Code:custom Message:key_prefix must not end with a number} {Resource:KeyLink Field:key_prefix Code:custom Message:key_prefix must only contain letters, numbers, or .-_+=:/#}]
│ 
│   with github_repository_autolink_reference.all["apiv2_PTFY25"],
│   on repository.tf line 189, in resource "github_repository_autolink_reference" "all":
│  189: resource "github_repository_autolink_reference" "all" {

Terraform Version

terraform ">= 1.9.8, < 1.10"
integration "v6.6.0"

Affected Resource(s)

  • github_repository_autolink_reference

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions