Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Persistent Drift Issue in github_branch_protection Resource Despite No Changes #2243

Open
1 task done
RoseSecurity opened this issue Apr 29, 2024 · 2 comments · May be fixed by #2549
Open
1 task done

[BUG]: Persistent Drift Issue in github_branch_protection Resource Despite No Changes #2243

RoseSecurity opened this issue Apr 29, 2024 · 2 comments · May be fixed by #2549
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented

Comments

@RoseSecurity
Copy link

Expected Behavior

Within the github_branch_protection resource, I have a restrict_pushes block that allows pushes to the protected branch by fetching the github_user node_id.

  restrict_pushes {
    blocks_creations = var.restrict_pushes_blocks_creations
    push_allowances = var.push_restrictions_enabled ? [
      join("", data.github_user.allowed_user[*].node_id),
    ] : []
  }

Every time I run a plan or apply, it shows drift and that the resource needs to be updated in place although the value remains the same.

Actual Behavior

This is how each plan and apply appears:

  # github_branch_protection.default[0] will be updated in-place
  ~ resource "github_branch_protection" "default" {
        id                              = "BPR_XXXXXXXXXXXX"
        # (10 unchanged attributes hidden)

      ~ restrict_pushes {
          ~ push_allowances  = [
              + "U_XXXXXXXX",
            ]
            # (1 unchanged attribute hidden)
        }

        # (1 unchanged block hidden)
    }

Terraform Version

Terraform v1.5.6 on M1 Mac with integrations/github v6.2.1

Affected Resource(s)

  • github_branch_protection

Terraform Configuration Files

No response

Steps to Reproduce

No response

Debug Output

# github_branch_protection.default[0] will be updated in-place
  ~ resource "github_branch_protection" "default" {
        id                              = "BPR_XXXXXXXXXXXX"
        # (10 unchanged attributes hidden)

      ~ restrict_pushes {
          ~ push_allowances  = [
              + "U_XXXXXXXX",
            ]
            # (1 unchanged attribute hidden)
        }

        # (1 unchanged block hidden)
    }

Panic Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@RoseSecurity RoseSecurity added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Apr 29, 2024
@kfcampbell kfcampbell moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Apr 29, 2024
@kfcampbell kfcampbell added Status: Up for grabs Issues that are ready to be worked on by anyone and removed Status: Triage This is being looked at and prioritized labels Apr 29, 2024
Copy link

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

@github-actions github-actions bot added the Status: Stale Used by stalebot to clean house label Jan 25, 2025
@RoseSecurity
Copy link
Author

I'll gladly work on this issue if no one else will pick it up

@github-actions github-actions bot removed the Status: Stale Used by stalebot to clean house label Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented
Projects
None yet
2 participants