You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
github_branch_protection is not creating restriction if only a single team is provided. #269
For me some similar issue occurred: when a repo permissions for a team and a repo branch protection depending on the same team are created in the same run, the team is not listed in the branch protection. Deleting the protection and adding it (using terraform) again, works.
The official documentation states: teams: (Optional) The list of team slugs with push access. Always use slug of the team, not its name. Each team already has to have access to the repository.
Thus I could image that their exists some kind of race-condition, because the team seems not to have the appropriate permissions during creation of the branch protection.
We have the same problem as @mmoscher, but with Terraform 0.12.16:
If you assign a repository to a team, and want to use that team for branch protection, the assignment works, but the team is not set for branch protection (it actually is set in the state file, but not on GitHub).
If you then unset the team for branch protection, apply, re-set it, and apply again, it's there.
So yes, our impression is as well that there is a race condition. We have not yet tried to fix this with depends_on, but of course it would be way nicer if the GitHub provider would solve this internally.
PS: Meanwhile we have tried it, and a depends_on seems to work as a workaround.
👋 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!
👋 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!
Activity
iniinikoski commentedon Aug 27, 2019
Hmm, I'm working on the same topic here - but seems to work here... Will post more info soon...
mmoscher commentedon Aug 28, 2019
For me some similar issue occurred: when a repo permissions for a team and a repo branch protection depending on the same team are created in the same run, the team is not listed in the branch protection. Deleting the protection and adding it (using terraform) again, works.
The official documentation states:
teams: (Optional) The list of team slugs with push access. Always use slug of the team, not its name. Each team already has to have access to the repository.Thus I could image that their exists some kind of race-condition, because the team seems not to have the appropriate permissions during creation of the branch protection.
Maybe an
depends_oncould fix this.goloroden commentedon Dec 3, 2019
We have the same problem as @mmoscher, but with Terraform 0.12.16:
If you assign a repository to a team, and want to use that team for branch protection, the assignment works, but the team is not set for branch protection (it actually is set in the state file, but not on GitHub).
If you then unset the team for branch protection, apply, re-set it, and apply again, it's there.
So yes, our impression is as well that there is a race condition. We have not yet tried to fix this with
depends_on, but of course it would be way nicer if the GitHub provider would solve this internally.PS: Meanwhile we have tried it, and a
depends_onseems to work as a workaround.github-actions commentedon Dec 11, 2022
👋 Hey Friends, this issue has been automatically marked as
stalebecause it has no recent activity. It will be closed if no further activity occurs. Please add theStatus: Pinnedlabel if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!github-actions commentedon Apr 24, 2024
👋 Hey Friends, this issue has been automatically marked as
stalebecause it has no recent activity. It will be closed if no further activity occurs. Please add theStatus: Pinnedlabel if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!