File tree Expand file tree Collapse file tree 4 files changed +11
-0
lines changed
Expand file tree Collapse file tree 4 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 2222 version : latest
2323 args : release
2424 env :
25+ GH_OAUTH_CLIENT_ID : 178c6fc778ccc68e1d6a
26+ GH_OAUTH_CLIENT_SECRET : ${{secrets.OAUTH_CLIENT_SECRET}}
2527 GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
2628 - name : Copy release
2729 id : copy
Original file line number Diff line number Diff line change 77 - binary : bin/gh
88 ldflags :
99 - -s -w -X github.com/github/gh-cli/command.Version={{.Version}} -X github.com/github/gh-cli/command.BuildDate={{.Date}}
10+ - -X github.com/github/gh-cli/context.oauthClientID={{.Env.GH_OAUTH_CLIENT_ID}}
11+ - -X github.com/github/gh-cli/context.oauthClientSecret={{.Env.GH_OAUTH_CLIENT_SECRET}}
1012 goos :
1113 - linux
1214 - darwin
Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ BUILD_FILES = $(shell go list -f '{{range .GoFiles}}{{$$.Dir}}/{{.}}\
44GH_VERSION = $(shell go describe --tags 2>/dev/null || git rev-parse --short HEAD)
55LDFLAGS := -X github.com/github/gh-cli/command.Version=$(GH_VERSION ) $(LDFLAGS )
66LDFLAGS := -X github.com/github/gh-cli/command.BuildDate=$(shell date +% Y-% m-% d) $(LDFLAGS )
7+ ifdef GH_OAUTH_CLIENT_SECRET
8+ LDFLAGS := -X github.com/github/gh-cli/context.oauthClientID=$(GH_OAUTH_CLIENT_ID) $(LDFLAGS)
9+ LDFLAGS := -X github.com/github/gh-cli/context.oauthClientSecret=$(GH_OAUTH_CLIENT_SECRET) $(LDFLAGS)
10+ endif
711
812bin/gh : $(BUILD_FILES )
913 @go build -ldflags " $( LDFLAGS) " -o " $@ "
Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ import (
1414
1515const (
1616 oauthHost = "github.com"
17+ )
18+
19+ var (
1720 // The GitHub app that is meant for development
1821 oauthClientID = "4d747ba5675d5d66553f"
1922 // This value is safe to be embedded in version control
You can’t perform that action at this time.
0 commit comments