Skip to content

[BUG]: Repository Delete File does not include author and comitter #2735

@11chrisg

Description

@11chrisg

Expected Behavior

Options used for making a deleting a file differs from create and update, delete commits do not provide author and committer. Therefore, deletes will not be verified and not accepted for repositories enforcing verified commits.

see: https://github.com/integrations/terraform-provider-github/blob/main/github/resource_github_repository_file.go#L470

Actual Behavior

Delete file should behave the same as create and update. If auther and committer is configured comits in github should have the verified batch, and if policy for only accepting verified commits is set should be accepted

Terraform Version

Terraform v1.12.2
on linux_amd64

Affected Resource(s)

  • github_repository_file

Terraform Configuration Files

// Create a file:

resource "github_repository_file" "foo" {
  repository          = "tmp"
  branch              = "main"
  file                = ".gitignore"
  content             = "**/*.tfstate"
  commit_message      = "Managed by Terraform"
  commit_author       = "Terraform User"
  commit_email        = "terraform@example.com"
  overwrite_on_create = true
}

Steps to Reproduce

// Delete created file by removing resource
// resource "github_repository_file" "foo" {
// repository = "tmp"
// branch = "main"
// file = ".gitignore"
// content = "**/*.tfstate"
// commit_message = "Managed by Terraform"
// commit_author = "Terraform User"
// commit_email = "terraform@example.com"
// overwrite_on_create = true
// }}

Debug Output

Panic Output

Code of Conduct

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is being looked at and prioritizedType: BugSomething isn't working as documented

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions