Skip to content

Commit

Permalink
Skip descriptiveness check if the "skip-descriptiveness-check" flag i…
Browse files Browse the repository at this point in the history
…s set.

Signed-off-by: Adrian Orive <adrian.orive.oneca@gmail.com>
  • Loading branch information
Adirio committed Feb 2, 2021
1 parent ee3a5c2 commit 42ee935
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions verify/descriptiveness.go
Expand Up @@ -22,6 +22,8 @@ import (
"sigs.k8s.io/kubebuilder-release-tools/verify/pkg/action"
)

const skipDescriptivenessCheckLabel = "skip-descriptiveness-check"

type prDescriptivenessError struct{}

func (e prDescriptivenessError) Error() string {
Expand All @@ -36,6 +38,12 @@ Someone reading the PR description without clicking any issue links should be ab
// checkPRDescriptiveness
func checkPRDescriptiveness(requiredCharacters int) action.ValidateFunc {
return func(pr *github.PullRequest) (string, string, error) {
for _, label := range pr.Labels {
if *label.Name == skipDescriptivenessCheckLabel {
return "Skipping descriptiveness check!", "", nil
}
}

if len(pr.GetBody()) < requiredCharacters {
return "", "", &prDescriptivenessError{}
}
Expand Down

0 comments on commit 42ee935

Please sign in to comment.