Skip to content

Commit

Permalink
fix: Skip asking GH token for local scans (#635)
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Kopysov <[email protected]>
  • Loading branch information
o-kopysov authored Oct 7, 2024
1 parent f8b7b1a commit 55b3650
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package com.lpvs.service;

import com.lpvs.util.LPVSExitHandler;
import io.micrometer.common.util.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.kohsuke.github.GitHub;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -25,6 +26,12 @@
@Slf4j
public class LPVSGitHubConnectionService {

/**
* Trigger value to start a single scan of local files or folder.
*/
@Value("${local.path:}")
private String localPath;

/**
* GitHub login username.
*/
Expand Down Expand Up @@ -115,7 +122,7 @@ public LPVSGitHubConnectionService(
*/
@PostConstruct
private void checks() {
if (this.GITHUB_AUTH_TOKEN.isEmpty()) {
if (this.GITHUB_AUTH_TOKEN.isEmpty() && StringUtils.isBlank(localPath)) {
log.error(
GITHUB_AUTH_TOKEN_ENV_VAR_NAME
+ "("
Expand Down

0 comments on commit 55b3650

Please sign in to comment.