forked from slsa-framework/slsa-verifier
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor and add BuildType interface (slsa-framework#47)
* Refactor and add BuildType interface * Don't implement URI on GithubActionsBuild * Add gitignore * Add gitignore * Update Go builder * Sync dependencies. * Fix dependencies by running go mod tidy in each * Revert builders/go/ * Revert detect-workflow
- Loading branch information
Ian Lewis
authored
May 26, 2022
1 parent
76ce8e1
commit 2f211f0
Showing
11 changed files
with
652 additions
and
453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package github | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/google/go-github/v44/github" | ||
"golang.org/x/oauth2" | ||
) | ||
|
||
// NewGithubClient returns a new Github API client authenticated using the | ||
// token from the github context. | ||
func NewGithubClient(ctx context.Context) (*github.Client, error) { | ||
t, err := GetToken() | ||
if err != nil { | ||
return nil, err | ||
} | ||
return github.NewClient(oauth2.NewClient(ctx, oauth2.StaticTokenSource( | ||
&oauth2.Token{AccessToken: t}, | ||
))), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.