profile
viewpoint

Ask questionscannot find package "github.com/google/go-github/v29/github"

Describe the bug we have cicd simple stage to execute gitleak :

.gitleaks:
  stage: validate
  image: golang
  script:
    - echo "Scanning Git repository for leaking secrets"
    - go get -u github.com/zricethezav/gitleaks
    - gitleaks --repo-path="$PWD" --verbose $GITLEAKS_OPTS

To Reproduce

This stage was working well for a while, but recently we are facing the following issue

 $ go get -u github.com/zricethezav/gitleaks
 package github.com/google/go-github/v29/github: cannot find package "github.com/google/go-github/v29/github" in any of:
 	/usr/local/go/src/github.com/google/go-github/v29/github (from $GOROOT)
 	/go/src/github.com/google/go-github/v29/github (from $GOPATH)
 ERROR: Job failed: exit code 1

Screenshots If applicable, add screenshots to help explain your problem. image

Basic Info (please complete the following information):

  • GitLab Community Edition 12.8.8

cc @zricethezav

zricethezav/gitleaks

Answer questions boly38

Hi @zricethezav ,

I test it again and here are my tests results as today:

.gitleaks:
  stage: validate
  image: golang:1.14.2-alpine3.11
  script:
    - echo "Scanning Git repository for leaking secrets"
    - export GO111MODULE=on;
    - go get -u github.com/zricethezav/gitleaks
    - gitleaks --repo-path=\"$PWD\" --verbose $GITLEAKS_OPTS
  • with export GO111MODULE=on; : go get downloads deps and gitleaks execution ok - I'll keep this state for now

  • without export GO111MODULE=on; line :

 $ go get -u github.com/zricethezav/gitleaks
 go: missing Git command. See https://golang.org/s/gogetcmd
 package github.com/zricethezav/gitleaks: exec: "git": executable file not found in $PATH
  • with image: golang (solved with image sha256:2421885b04daf2f5095c46fe1889887d89e5ab77157e54423d97ea6816db54b6) && without export GO111MODULE=on; line :
 $ go get -u github.com/zricethezav/gitleaks
 package github.com/go-git/go-billy/osfs: code in directory /go/src/github.com/go-git/go-billy/osfs expects import "github.com/go-git/go-billy/v5/osfs"
>Running after_script
Uploading artifacts for failed job
> ERROR: Job failed: exit code 1

(I've no more details this this last one, took a little time after osfs line log)

useful!

Related questions

No questions were found.
source:https://uonfu.com/
Github User Rank List