From a231cc47295553e5285901cd88d9ea048c810bc1 Mon Sep 17 00:00:00 2001 From: Bernd Ahlers Date: Wed, 2 Aug 2023 17:30:32 +0200 Subject: [PATCH] No issues or pulls are fine for GHSA changelog snippets --- changelog/lint.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog/lint.go b/changelog/lint.go index 719c06d..9ffcd63 100644 --- a/changelog/lint.go +++ b/changelog/lint.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/Graylog2/graylog-project-cli/logger" "github.com/Graylog2/graylog-project-cli/utils" + "path/filepath" "strings" "time" ) @@ -50,7 +51,9 @@ func LintPaths(paths []string, strict bool) error { } } - if len(urlList) == 0 { + // The GitHub security advisories (GHSA) might not have linked issues or pulls because the PRs might be + // created in private forks as part of the security advisory process. + if len(urlList) == 0 && !strings.HasPrefix(strings.ToLower(filepath.Base(file)), "ghsa-") { errors = append(errors, fmt.Errorf("linter error in file %s: at least one issue or pull request number needs to be present", file)) continue }