@@ -34,7 +34,7 @@ This behavior can be further customized using environment variables: setting LGT
34
34
to 'false' disables the GOPATH set-up, CODEQL_EXTRACTOR_GO_BUILD_COMMAND (or alternatively
35
35
LGTM_INDEX_BUILD_COMMAND), can be set to a newline-separated list of commands to run in order to
36
36
install dependencies, and LGTM_INDEX_IMPORT_PATH can be used to override the package import path,
37
- which is otherwise inferred from the SEMMLE_REPO_URL environment variable .
37
+ which is otherwise inferred from the SEMMLE_REPO_URL or GITHUB_REPOSITORY environment variables .
38
38
39
39
In resource-constrained environments, the environment variable CODEQL_EXTRACTOR_GO_MAX_GOROUTINES
40
40
(or its legacy alias SEMMLE_MAX_GOROUTINES) can be used to limit the number of parallel goroutines
@@ -100,13 +100,19 @@ func getImportPath() (importpath string) {
100
100
if importpath == "" {
101
101
repourl := os .Getenv ("SEMMLE_REPO_URL" )
102
102
if repourl == "" {
103
- log .Printf ("Unable to determine import path, as neither LGTM_INDEX_IMPORT_PATH nor SEMMLE_REPO_URL is set\n " )
104
- return ""
105
- }
106
- importpath = getImportPathFromRepoURL (repourl )
107
- if importpath == "" {
108
- log .Printf ("Failed to determine import path from SEMMLE_REPO_URL '%s'\n " , repourl )
109
- return
103
+ githubrepo := os .Getenv ("GITHUB_REPOSITORY" )
104
+ if githubrepo == "" {
105
+ log .Printf ("Unable to determine import path, as neither LGTM_INDEX_IMPORT_PATH nor GITHUB_REPOSITORY is set\n " )
106
+ return ""
107
+ } else {
108
+ importpath = "github.com/" + githubrepo
109
+ }
110
+ } else {
111
+ importpath = getImportPathFromRepoURL (repourl )
112
+ if importpath == "" {
113
+ log .Printf ("Failed to determine import path from SEMMLE_REPO_URL '%s'\n " , repourl )
114
+ return
115
+ }
110
116
}
111
117
}
112
118
log .Printf ("Import path is '%s'\n " , importpath )
0 commit comments