Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yo May authored and yoanm committed Jan 21, 2024
1 parent d66f1b4 commit f5493b1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions core/gh2tf_repo_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const (
var falseString = "false"

// Replace branch protection pattern's special chars by dedicated string in order to avoid ID collision (pattern is used for TF ressource generation)

Check failure on line 28 in core/gh2tf_repo_mapper.go

View workflow job for this annotation

GitHub Actions / Static checks

line is 149 characters (lll)
// in case every special chars are replaced by the same string => "?.*", "[.]" or "?/?" would all lead to the same "---" ID for instance
var patternToIdReplacer = strings.NewReplacer(
// in case every special chars are replaced by the same string => "?.*", "[.]" or "?/?" would all lead to the same "---" ID for instance.

Check failure on line 29 in core/gh2tf_repo_mapper.go

View workflow job for this annotation

GitHub Actions / Static checks

line is 137 characters (lll)
var patternToIdReplacer = strings.NewReplacer(
".", "_DOT_",
"/", "_SLASH_",
"\\", "_ESC_",
Expand Down
4 changes: 2 additions & 2 deletions core/testdata/repo1.full.golden.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ resource "github_branch_protection" "repo1-default" {
}
}

resource "github_branch_protection" "repo1-feature-branch1" {
resource "github_branch_protection" "repo1-feature_SLASH_branch1" {
repository_id = github_repository.repo1.node_id
pattern = "feature/branch1"
enforce_admins = true
Expand All @@ -111,7 +111,7 @@ resource "github_branch_protection" "repo1-feature-branch1" {
}
}

resource "github_branch_protection" "repo1-feature-branch2" {
resource "github_branch_protection" "repo1-feature_SLASH_branch2" {
repository_id = github_repository.repo1.node_id
pattern = "feature/branch2"
enforce_admins = false
Expand Down
4 changes: 2 additions & 2 deletions core/testdata/repo2.full.golden.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ resource "github_branch_protection" "repo2-default" {
}
}

resource "github_branch_protection" "repo2-feature-branch2" {
resource "github_branch_protection" "repo2-feature_SLASH_branch2" {
repository_id = github_repository.repo2.node_id
pattern = "feature/branch2"
enforce_admins = false
Expand All @@ -111,7 +111,7 @@ resource "github_branch_protection" "repo2-feature-branch2" {
}
}

resource "github_branch_protection" "repo2-feature-branch3" {
resource "github_branch_protection" "repo2-feature_SLASH_branch3" {
repository_id = github_repository.repo2.node_id
pattern = "feature/branch3"
enforce_admins = true
Expand Down

0 comments on commit f5493b1

Please sign in to comment.