Skip to content

A plan diff happens after archiving repository #1325

@kangaechu

Description

@kangaechu

Terraform Version

$ terraform -v
Terraform v1.3.2
on darwin_amd64
+ provider registry.terraform.io/integrations/github v5.4.0

Affected Resource(s)

  • github_repository

Terraform Configuration Files

terraform {
  required_version = "1.3.2"

  required_providers {
    github = {
      source  = "integrations/github"
      version = "5.4.0"
    }
  }
}

provider "github" {
  owner = "kangaechu"
}

resource "github_repository" "archive_test" {
  archived               = "false"
  delete_branch_on_merge = "false"
  description            = ""
  has_downloads          = "true"
  has_issues             = "true"
  has_projects           = "true"
  has_wiki               = "true"
  is_template            = "false"
  name                   = "archive-test"
  visibility             = "public"
  vulnerability_alerts   = "true"
  allow_merge_commit     = "true"
  allow_rebase_merge     = "true"
  allow_squash_merge     = "true"
}

Debug Output

https://gist.github.com/kangaechu/c1d7bc3a48fb2c4e5dd567d9fa675fa6

Expected Behavior

No changes.

Actual Behavior

There is a plan diff.

$ terraform plan
github_repository.archive_test: Refreshing state... [id=archive-test]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # github_repository.archive_test will be updated in-place
  ~ resource "github_repository" "archive_test" {
      ~ allow_merge_commit          = false -> true
      ~ allow_rebase_merge          = false -> true
      ~ allow_squash_merge          = false -> true
        id                          = "archive-test"
      + merge_commit_message        = "PR_TITLE"
      + merge_commit_title          = "MERGE_MESSAGE"
        name                        = "archive-test"
      + squash_merge_commit_message = "COMMIT_MESSAGES"
      + squash_merge_commit_title   = "COMMIT_OR_PR_TITLE"
      ~ vulnerability_alerts        = false -> true
        # (20 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
  2. change archived parameter to true
  3. terraform apply
  4. terraform plan

notice

TF_LOG=debug terraform plan displays following warnings.

2022-10-13T10:09:46.370+0900 [WARN]  Provider "registry.terraform.io/integrations/github" produced an invalid plan for github_repository.archive_test, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .merge_commit_title: planned value cty.StringVal("MERGE_MESSAGE") for a non-computed attribute
      - .squash_merge_commit_message: planned value cty.StringVal("COMMIT_MESSAGES") for a non-computed attribute
      - .squash_merge_commit_title: planned value cty.StringVal("COMMIT_OR_PR_TITLE") for a non-computed attribute
      - .homepage_url: planned value cty.StringVal("") for a non-computed attribute
      - .allow_auto_merge: planned value cty.False for a non-computed attribute
      - .merge_commit_message: planned value cty.StringVal("PR_TITLE") for a non-computed attribute

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