Skip to content

Commit 582a6d9

Browse files
lucian-ioanendorama
authored andcommitted
Add pr-has-fragment failure guidance (#99)
1 parent 44ede0b commit 582a6d9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmd/pr_has_fragment.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func PrHasFragmentCommand(appFs afero.Fs) *cobra.Command {
6060
return err
6161
}
6262
if shouldSkip {
63-
fmt.Fprintln(cmd.OutOrStdout(), "PR requires no changelog")
63+
fmt.Fprintf(cmd.OutOrStdout(), "PR requires no changelog because it has one of these labels: %q\n", labels)
6464
return nil
6565
}
6666

@@ -71,7 +71,9 @@ func PrHasFragmentCommand(appFs afero.Fs) *cobra.Command {
7171
return err
7272
}
7373
if !found {
74-
return fmt.Errorf("fragment not present in PR %d", pr)
74+
return fmt.Errorf("fragment not present in PR %d, to resolve this do one of the following:\n"+
75+
"1) add a fragment using the 'new' command\n"+
76+
"2) add a label (one of: %q) to skip validation", pr, labels)
7577
}
7678

7779
return nil

0 commit comments

Comments
 (0)