Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Look for organisation default .github security.md files in all the locations they are allowed to be in #837

Merged
merged 4 commits into from
Aug 11, 2021

Conversation

iamamoose
Copy link
Contributor

Signed-off-by: Mark J. Cox mark@awe.com

  • Please check if the PR fulfills these requirements
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Bug fix

  • What is the current behavior? (You can also link to an open issue here)

The default community health files for an organisation can be in one of three directories, but the current check only looks in one of them (the root). Expand the check to all three places as per
https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/creating-a-default-community-health-file
to look in the .github and docs directories of the .github repo.

This fixes scorecards failing to pick up the default Apache policy
https://github.com/apache/.github/blob/main/.github/SECURITY.md

  • What is the new behavior (if this is a feature change)?

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

  • Other information:

three places, but the current check only looked in one of them. Expand
the check to all three places as per
https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/creating-a-default-community-health-file

This fixes scorecards failing to pick up the default Apache policy
https://github.com/apache/.github/blob/main/.github/SECURITY.md

Signed-off-by: Mark J. Cox <mark@awe.com>
Copy link
Member

@naveensrinivasan naveensrinivasan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@naveensrinivasan
Copy link
Member

naveensrinivasan commented Aug 11, 2021

Can you please fix this

checks/security_policy.go:74: line is 143 characters (lll)
			if strings.EqualFold(name, "security.md") || strings.EqualFold(name, ".github/security.md") || strings.EqualFold(name, "docs/security.md") {
make: *** [Makefile:60: check-linter] Error 1

?

https://github.com/ossf/scorecard/pull/837/checks?check_run_id=3298907938

@naveensrinivasan naveensrinivasan enabled auto-merge (squash) August 11, 2021 14:10
@iamamoose
Copy link
Contributor Author

iamamoose commented Aug 11, 2021

sorry, this is the first time I've written anything for golang so I'm not sure how to structure the multi-line to have it pass the code style check (ok, following the suggestion in the failure message to run gofmt -s on it!)

auto-merge was automatically disabled August 11, 2021 14:15

Head branch was pushed to by a user without write access

@inferno-chromium inferno-chromium merged commit 20370f7 into ossf:main Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants