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]build error, fatal: unsafe repository #60

Closed
moonD4rk opened this issue Apr 25, 2022 · 1 comment · Fixed by #62
Closed

[BUG]build error, fatal: unsafe repository #60

moonD4rk opened this issue Apr 25, 2022 · 1 comment · Fixed by #62

Comments

@moonD4rk
Copy link
Contributor

moonD4rk commented Apr 25, 2022

Hi, build error when I use xgo, seems it's github action vul limit. actions/checkout#760

may be need set safe dir before build with golang

git config --global --add safe.directory /source

here's my build error info.

Run crazy-max/ghaction-xgo@v1
✅ xgo version found: v0.14.0
⬇️ Downloading https://github.com/crazy-max/xgo/releases/download/v0.14.0/xgo_0.14.0_linux_x86_64.tar.gz...
📦 Extracting xgo...
......
Building /source/go.mod...
Compiling for windows-4.0/amd64...
+ CC=x86_64-w64-mingw32-gcc
+ CXX=x86_64-w64-mingw32-g++
+ GOOS=windows
+ GOARCH=amd64
+ CGO_ENABLED=1
+ CGO_CFLAGS=-D_WIN32_WINNT=0x0400
+ CGO_CXXFLAGS=-D_WIN32_WINNT=0x0400
+ go build -v '--ldflags=-v -s -w' -o /build/hack-browser-data-windows-4.0-amd64.exe ./cmd/hack-browser-data
go: downloading github.com/urfave/cli/v2 v2.4.0
go: downloading github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db
# cd /source; git status --porcelain
fatal: unsafe repository ('/source' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /source
error obtaining VCS status: exit status 128
	Use -buildvcs=false to disable VCS stamping.
......

here's my github actions script with crazy-max/ghaction-xgo

@matthewp
Copy link

Hey @crazy-max, I've run into the above as well. Can we try @moonD4rk's fix and see if that covers it?

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 a pull request may close this issue.

2 participants