From ecb378333696db76c24203b8dacd9462009919be Mon Sep 17 00:00:00 2001 From: favonia Date: Thu, 10 Nov 2022 00:37:45 -0600 Subject: [PATCH] Detect SECURITY.markdown in addition to SECURITY.md GitHub probably supports many more file extensions for Markdown files, but at the very least, `.md` and `.markdown` have been standardized in RFC 7763. Signed-off-by: favonia --- checks/raw/security_policy.go | 3 +++ checks/raw/security_policy_test.go | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/checks/raw/security_policy.go b/checks/raw/security_policy.go index 86fc7e87919..9469d625c8a 100644 --- a/checks/raw/security_policy.go +++ b/checks/raw/security_policy.go @@ -143,6 +143,9 @@ func isSecurityPolicyFilename(name string) bool { return strings.EqualFold(name, "security.md") || strings.EqualFold(name, ".github/security.md") || strings.EqualFold(name, "docs/security.md") || + strings.EqualFold(name, "security.markdown") || + strings.EqualFold(name, ".github/security.markdown") || + strings.EqualFold(name, "docs/security.markdown") || strings.EqualFold(name, "security.adoc") || strings.EqualFold(name, ".github/security.adoc") || strings.EqualFold(name, "docs/security.adoc") || diff --git a/checks/raw/security_policy_test.go b/checks/raw/security_policy_test.go index f9c98caa984..67abd80ca2f 100644 --- a/checks/raw/security_policy_test.go +++ b/checks/raw/security_policy_test.go @@ -93,6 +93,27 @@ func TestSecurityPolicy(t *testing.T) { }, path: "", }, + { + name: "security.markdown", + files: []string{ + "security.markdown", + }, + path: "", + }, + { + name: ".github/security.markdown", + files: []string{ + ".github/security.markdown", + }, + path: "", + }, + { + name: "docs/security.markdown", + files: []string{ + "docs/security.markdown", + }, + path: "", + }, { name: "docs/security.rst", files: []string{