Skip to content

Commit

Permalink
Detect SECURITY.markdown in addition to SECURITY.md (ossf#2447)
Browse files Browse the repository at this point in the history
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 <[email protected]>

Signed-off-by: favonia <[email protected]>
Signed-off-by: nathaniel.wert <[email protected]>
  • Loading branch information
favonia authored and nathaniel.wert committed Nov 28, 2022
1 parent f053321 commit 4e08ce3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions checks/raw/security_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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") ||
Expand Down
21 changes: 21 additions & 0 deletions checks/raw/security_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 4e08ce3

Please sign in to comment.