exasol / github-keeper

Tool for unifying our GitHub repository setup. Superseded by github-issue-adapter
MIT License
2 stars 1 forks source link

create-branch-protection fails #19

Closed jakobbraun closed 2 years ago

jakobbraun commented 2 years ago

The create-branch-protection command fails for small-json-files-test-fixture with

panic: Failed to create branch protection for exasol/small-json-files-test-fixture/main. Cause: PUT https://api.github.com/repos/exasol/small-json-files-test-fixture/branches/main/protection: 422 Validation Failed [{Resource:RequiredStatusCheck Field:context Code:already_exists Message:}]

goroutine 1 [running]:
github.com/exasol/github-keeper/cmd.FixBranchProtectionProblemHandler.createBranchProtection(0xc000080780, 0x7fffc57a9ffc, 0x1d, 0xc000407628, 0x4, 0xc000020380)
        /home/jakob/exasol/github-keeper/cmd/branchProtection.go:56 +0x315
github.com/exasol/github-keeper/cmd.BranchProtectionVerifier.checkIfBranchProtectionIsApplied(0x7fffc57a9ffc, 0x1d, 0xc000080780, 0xc0000f0101)
        /home/jakob/exasol/github-keeper/cmd/branchProtection.go:74 +0x42b
github.com/exasol/github-keeper/cmd.glob..func1(0xdb6640, 0xc0000aa5a0, 0x1, 0x2)
        /home/jakob/exasol/github-keeper/cmd/branchProtection.go:23 +0xcf
github.com/spf13/cobra.(*Command).execute(0xdb6640, 0xc0000aa580, 0x2, 0x2, 0xdb6640, 0xc0000aa580)
        /home/jakob/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:860 +0x2aa
github.com/spf13/cobra.(*Command).ExecuteC(0xdb6140, 0x43cf1a, 0xd7b1c0, 0xc000000180)
        /home/jakob/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x35a
github.com/spf13/cobra.(*Command).Execute(...)
        /home/jakob/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902
github.com/exasol/github-keeper/cmd.Execute()
        /home/jakob/exasol/github-keeper/cmd/root.go:16 +0x31
main.main()
        /home/jakob/exasol/github-keeper/main.go:6 +0x20
exit status 2