Skip to content

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

Closed

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

Activity

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

    @deiga
    Collaborator

    Thanks @MarkVaughn for raising this. We weren't aware that such a rule existed on the API.
    Would love to see a PR to add this validation! :)

  4. added
    Status: Up for grabs
    Good first issue
    and removed
    Status: Triage
    on Feb 9, 2026
  5. Jwels1 commented on Mar 1, 2026

    @Jwels1

    @deiga I've got that PR to do this validation. Let me know if there's anything else I can do!

  6. added this to the v6.13.0 milestone on Jun 24, 2026
  7. removed
    Status: Up for grabs
    on Jun 24, 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

    Good first issueType: Bugr/repository_autolink_reference

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions