Skip to content

Commit

Permalink
fix: allow lobicornis to merge PR where skipped job are present
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatur authored Aug 30, 2024
1 parent 2fd0ac3 commit 34ad84b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
env:
GO_VERSION: stable
GOLANGCI_LINT_VERSION: v1.55.2
GOLANGCI_LINT_VERSION: v1.60.3
CGO_ENABLED: 0

steps:
Expand Down
21 changes: 5 additions & 16 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
run:
timeout: 2m
skip-files:
- ^unsecured/

linters-settings:
govet:
check-shadowing: true
shadow: true
gocyclo:
min-complexity: 23
goconst:
Expand All @@ -25,26 +23,15 @@ linters-settings:
linters:
enable-all: true
disable:
- maligned # deprecated
- interfacer # deprecated
- scopelint # deprecated
- golint # deprecated
- ifshort # deprecated
- varcheck # deprecated
- deadcode # deprecated
- nosnakecase # deprecated
- structcheck # deprecated
- exhaustivestruct # deprecated
- execinquery # not relevant (SQL)
- sqlclosecheck # not relevant (SQL)
- rowserrcheck # not relevant (SQL)
- cyclop # duplicate of gocyclo
- mnd
- contextcheck
- lll
- gas
- dupl
- prealloc
- scopelint
- gomnd
- wsl
- nlreturn
Expand All @@ -53,7 +40,7 @@ linters:
- testpackage
- paralleltest
- tparallel
- goerr113
- err113
- wrapcheck
- exhaustive
- exhaustruct
Expand All @@ -68,6 +55,8 @@ issues:
exclude:
- 'ST1000: at least one file in a package should have a package comment'
- 'package-comments: should have a package comment'
- "G304: Potential file inclusion via variable"
- 'G114: Use of net/http serve function that has no support for setting timeouts'
exclude-rules:
- path: (.+)_test.go
linters:
Expand Down
2 changes: 2 additions & 0 deletions pkg/repository/repository_review.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const (
InProgress = "in_progress"
// Queued Check state.
Queued = "queued"
// Skipped Check state.
Skipped = "skipped"

// Approved Review state.
Approved = "APPROVED"
Expand Down
2 changes: 1 addition & 1 deletion pkg/repository/repository_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (r *Repository) getAggregatedState(ctx context.Context, pr *github.PullRequ
return "", err
}

if status == Pending || status == Success {
if status == Pending || status == Success || status == Skipped {
return status, nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/repository/repository_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (r *Repository) getUpdateAction(ctx context.Context, pr *github.PullRequest
output, err := git.RawWithContext(ctx, "log", func(g *types.Cmd) {
g.AddOptions("--oneline")
g.AddOptions("--merges")
g.AddOptions(fmt.Sprintf("%s^..HEAD", firstCommit.GetSHA()))
g.AddOptions(firstCommit.GetSHA() + "^..HEAD")
})
if err != nil {
log.Ctx(ctx).Error().Err(err).Msg(output)
Expand Down

0 comments on commit 34ad84b

Please # to comment.