Skip to content

Commit

Permalink
fix: Limit branch protection for GH Pages when using separate branch
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarea committed Apr 20, 2022
1 parent 1aacb42 commit be53f82
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ resource "github_branch_protection" "main" {
}

resource "github_branch_protection" "gh_pages" {
count = var.pages_source_path != null && var.pages_source_branch != var.main_branch ? 1 : 0

repository_id = github_repository.main.node_id
pattern = "gh-pages"
pattern = var.pages_source_branch

enforce_admins = true

Expand Down

0 comments on commit be53f82

Please sign in to comment.