Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: lint (#15806)

Danny Xu2095146c9361
diff --git a/.github/workflows/backend-tests-default.yml b/.github/workflows/backend-tests-default.yml
index d2cb1b783f..ed2bf067e6 100644
--- a/.github/workflows/backend-tests-default.yml
+++ b/.github/workflows/backend-tests-default.yml
@@ -9,6 +9,7 @@ on:
- 'backend/**'
- 'go.mod'
- 'proto/**/*.go'
+ - 'action/**'
jobs:
go-tests:
diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml
index e3d6297422..aed367e4e5 100644
--- a/.github/workflows/backend-tests.yml
+++ b/.github/workflows/backend-tests.yml
@@ -9,6 +9,7 @@ on:
- 'backend/**'
- 'go.mod'
- 'proto/**/*.go'
+ - 'action/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
diff --git a/action/azure_devops.go b/action/azure_devops.go
index c8bba6026a..d7b8e83524 100644
--- a/action/azure_devops.go
+++ b/action/azure_devops.go
@@ -3,6 +3,8 @@ package main
import (
"fmt"
+ "github.com/pkg/errors"
+
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
@@ -25,9 +27,10 @@ func loggingReleaseChecks(resp *v1pb.CheckReleaseResponse) error {
if len(advices) > 0 {
fmt.Printf("%s with %s has %d advices\n", result.File, result.Target, len(advices))
for _, advice := range result.Advices {
- if advice.Status == v1pb.Advice_WARNING {
+ switch advice.Status {
+ case v1pb.Advice_WARNING:
hasWarning = true
- } else if advice.Status == v1pb.Advice_ERROR {
+ case v1pb.Advice_ERROR:
hasError = true
}
@@ -60,7 +63,7 @@ func loggingReleaseChecks(resp *v1pb.CheckReleaseResponse) error {
}
if hasError {
- return fmt.Errorf("SQL review failed with errors")
+ return errors.Errorf("SQL review failed with errors")
}
return nil
}
diff --git a/action/main.go b/action/main.go
index 4eda24dcca..3d95bd01fb 100644
--- a/action/main.go
+++ b/action/main.go
@@ -49,11 +49,12 @@ func run(platform JobPlatform) error {
if err != nil {
return err
}
- if platform == GitLab {
+ switch platform {
+ case GitLab:
if err := writeReleaseCheckToCodeQualityJSON(checkReleaseResponse); err != nil {
return err
}
- } else if platform == AzureDevOps {
+ case AzureDevOps:
if err := loggingReleaseChecks(checkReleaseResponse); err != nil {
return err
}