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]>
  • Loading branch information
favonia authored and raghavkaul committed Feb 9, 2023
1 parent c9dae73 commit 529465d
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 @@ -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") ||
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 529465d

Please sign in to comment.