MCPcopy
hub / github.com/1Password/for-open-source / Init

Method Init

script/github.go:20–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18}
19
20func (g *GitHub) Init() error {
21 if isTesting() {
22 debugMessage("Skipping GitHub Init")
23 return nil
24 }
25
26 token, err := getEnv("OP_BOT_PAT")
27 if err != nil {
28 return err
29 }
30
31 repoOwnerValue, err := getEnv("REPOSITORY_OWNER")
32 if err != nil {
33 return err
34 }
35 g.RepoOwner = repoOwnerValue
36
37 repoNameValue, err := getEnv("REPOSITORY_NAME")
38 if err != nil {
39 return err
40 }
41 g.RepoName = repoNameValue
42
43 ts := oauth2.StaticTokenSource(
44 &oauth2.Token{AccessToken: token},
45 )
46 tc := oauth2.NewClient(context.Background(), ts)
47
48 g.Client = github.NewClient(tc)
49
50 return nil
51}
52
53func (g *GitHub) InitIssue() error {
54 if isTesting() {

Callers 4

ApproveMethod · 0.80
AggregateMethod · 0.80
ReviewMethod · 0.80
mainFunction · 0.80

Calls 3

isTestingFunction · 0.85
debugMessageFunction · 0.85
getEnvFunction · 0.85

Tested by

no test coverage detected