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

BUG: --local option is broken #1353

Closed
laurentsimon opened this issue Dec 3, 2021 · 4 comments
Closed

BUG: --local option is broken #1353

laurentsimon opened this issue Dec 3, 2021 · 4 comments
Assignees
Labels
kind/bug Something isn't working

Comments

@laurentsimon
Copy link
Contributor

laurentsimon commented Dec 3, 2021

at this line https://github.com/ossf/scorecard/blob/main/cmd/root.go#L322, we're creating clients that use GitHub APIs. When run on a local repo, this forces users to define a GitHub token which is not needed.

These clients should only be created if they are requested by a user who runs scorecard, i.e. if the checks are requested.

I think the fix is as simple as leaving these variables nil if the checks are not requested by users.

@laurentsimon laurentsimon added the kind/bug Something isn't working label Dec 3, 2021
@laurentsimon
Copy link
Contributor Author

@azeemsgoogle can you tackle this?

fyi, @naveensrinivasan this is another case that requires unit test to prevent it from happening again.

@laurentsimon
Copy link
Contributor Author

I'll take it, since I needed to fix it for testing anyway.

@azeemshaikh38
Copy link
Contributor

Ouch. I had also created a commit for it. We can go with your PR itself. Just added comment to your PR.

@laurentsimon
Copy link
Contributor Author

closed by #1355

naveensrinivasan added a commit that referenced this issue Mar 30, 2022
- Included e2e tests for security policy for localrepo client

#1353

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
naveensrinivasan added a commit that referenced this issue Mar 31, 2022
- Included e2e tests for security policy for localrepo client

#1353

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
naveensrinivasan added a commit that referenced this issue Mar 31, 2022
- Included e2e tests for security policy for localrepo client

#1353

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants