From 4e08ce31ac851c41525893ce5bcf741aba1a78a8 Mon Sep 17 00:00:00 2001 From: favonia Date: Thu, 10 Nov 2022 07:47:44 -0600 Subject: [PATCH] Detect SECURITY.markdown in addition to SECURITY.md (#2447) 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 Signed-off-by: favonia Signed-off-by: nathaniel.wert --- 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 de55b3b5594..b0c8977c6f8 100644 --- a/checks/raw/security_policy.go +++ b/checks/raw/security_policy.go @@ -155,6 +155,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{