Go library for accessing the GitHub API

Overview

go-github

GoDoc Test Status Test Coverage Discuss at go-github@googlegroups.com CII Best Practices

go-github is a Go client library for accessing the GitHub API v3.

Currently, go-github requires Go version 1.9 or greater. go-github tracks Go's version support policy. We do our best not to break older versions of Go if we don't have to, but due to tooling constraints, we don't always test older versions.

If you're interested in using the GraphQL API v4, the recommended library is shurcooL/githubv4.

Usage

import "github.com/google/go-github/v33/github"	// with go modules enabled (GO111MODULE=on or outside GOPATH)
import "github.com/google/go-github/github" // with go modules disabled

Construct a new GitHub client, then use the various services on the client to access different parts of the GitHub API. For example:

client := github.NewClient(nil)

// list all organizations for user "willnorris"
orgs, _, err := client.Organizations.List(context.Background(), "willnorris", nil)

Some API methods have optional parameters that can be passed. For example:

client := github.NewClient(nil)

// list public repositories for org "github"
opt := &github.RepositoryListByOrgOptions{Type: "public"}
repos, _, err := client.Repositories.ListByOrg(context.Background(), "github", opt)

The services of a client divide the API into logical chunks and correspond to the structure of the GitHub API documentation at https://docs.github.com/en/[email protected]/rest/reference/.

NOTE: Using the context package, one can easily pass cancelation signals and deadlines to various services of the client for handling a request. In case there is no context available, then context.Background() can be used as a starting point.

For more sample code snippets, head over to the example directory.

Authentication

The go-github library does not directly handle authentication. Instead, when creating a new client, pass an http.Client that can handle authentication for you. The easiest and recommended way to do this is using the oauth2 library, but you can always use any other library that provides an http.Client. If you have an OAuth2 access token (for example, a personal API token), you can use it with the oauth2 library using:

import "golang.org/x/oauth2"

func main() {
	ctx := context.Background()
	ts := oauth2.StaticTokenSource(
		&oauth2.Token{AccessToken: "... your access token ..."},
	)
	tc := oauth2.NewClient(ctx, ts)

	client := github.NewClient(tc)

	// list all repositories for the authenticated user
	repos, _, err := client.Repositories.List(ctx, "", nil)
}

Note that when using an authenticated Client, all calls made by the client will include the specified OAuth token. Therefore, authenticated clients should almost never be shared between different users.

See the oauth2 docs for complete instructions on using that library.

For API methods that require HTTP Basic Authentication, use the BasicAuthTransport.

GitHub Apps authentication can be provided by the ghinstallation package.

import "github.com/bradleyfalzon/ghinstallation"

func main() {
	// Wrap the shared transport for use with the integration ID 1 authenticating with installation ID 99.
	itr, err := ghinstallation.NewKeyFromFile(http.DefaultTransport, 1, 99, "2016-10-19.private-key.pem")
	if err != nil {
		// Handle error.
	}

	// Use installation transport with client.
	client := github.NewClient(&http.Client{Transport: itr})

	// Use client...
}

Rate Limiting

GitHub imposes a rate limit on all API clients. Unauthenticated clients are limited to 60 requests per hour, while authenticated clients can make up to 5,000 requests per hour. The Search API has a custom rate limit. Unauthenticated clients are limited to 10 requests per minute, while authenticated clients can make up to 30 requests per minute. To receive the higher rate limit when making calls that are not issued on behalf of a user, use UnauthenticatedRateLimitedTransport.

The returned Response.Rate value contains the rate limit information from the most recent API call. If a recent enough response isn't available, you can use RateLimits to fetch the most up-to-date rate limit data for the client.

To detect an API rate limit error, you can check if its type is *github.RateLimitError:

repos, _, err := client.Repositories.List(ctx, "", nil)
if _, ok := err.(*github.RateLimitError); ok {
	log.Println("hit rate limit")
}

Learn more about GitHub rate limiting at https://docs.github.com/en/[email protected]/rest/reference/rate-limit.

Accepted Status

Some endpoints may return a 202 Accepted status code, meaning that the information required is not yet ready and was scheduled to be gathered on the GitHub side. Methods known to behave like this are documented specifying this behavior.

To detect this condition of error, you can check if its type is *github.AcceptedError:

stats, _, err := client.Repositories.ListContributorsStats(ctx, org, repo)
if _, ok := err.(*github.AcceptedError); ok {
	log.Println("scheduled on GitHub side")
}

Conditional Requests

The GitHub API has good support for conditional requests which will help prevent you from burning through your rate limit, as well as help speed up your application. go-github does not handle conditional requests directly, but is instead designed to work with a caching http.Transport. We recommend using https://github.com/gregjones/httpcache for that.

Learn more about GitHub conditional requests at https://docs.github.com/en/[email protected]/rest/overview/resources-in-the-rest-api#conditional-requests.

Creating and Updating Resources

All structs for GitHub resources use pointer values for all non-repeated fields. This allows distinguishing between unset fields and those set to a zero-value. Helper functions have been provided to easily create these pointers for string, bool, and int values. For example:

// create a new private repository named "foo"
repo := &github.Repository{
	Name:    github.String("foo"),
	Private: github.Bool(true),
}
client.Repositories.Create(ctx, "", repo)

Users who have worked with protocol buffers should find this pattern familiar.

Pagination

All requests for resource collections (repos, pull requests, issues, etc.) support pagination. Pagination options are described in the github.ListOptions struct and passed to the list methods directly or as an embedded type of a more specific list options struct (for example github.PullRequestListOptions). Pages information is available via the github.Response struct.

client := github.NewClient(nil)

opt := &github.RepositoryListByOrgOptions{
	ListOptions: github.ListOptions{PerPage: 10},
}
// get all pages of results
var allRepos []*github.Repository
for {
	repos, resp, err := client.Repositories.ListByOrg(ctx, "github", opt)
	if err != nil {
		return err
	}
	allRepos = append(allRepos, repos...)
	if resp.NextPage == 0 {
		break
	}
	opt.Page = resp.NextPage
}

For complete usage of go-github, see the full package docs.

Integration Tests

You can run integration tests from the test directory. See the integration tests README.

Roadmap

This library is being initially developed for an internal application at Google, so API methods will likely be implemented in the order that they are needed by that application. You can track the status of implementation in this Google spreadsheet.

Contributing

I would like to cover the entire GitHub API and contributions are of course always welcome. The calling pattern is pretty well established, so adding new methods is relatively straightforward. See CONTRIBUTING.md for details.

Versioning

In general, go-github follows semver as closely as we can for tagging releases of the package. For self-contained libraries, the application of semantic versioning is relatively straightforward and generally understood. But because go-github is a client library for the GitHub API, which itself changes behavior, and because we are typically pretty aggressive about implementing preview features of the GitHub API, we've adopted the following versioning policy:

  • We increment the major version with any incompatible change to non-preview functionality, including changes to the exported Go API surface or behavior of the API.
  • We increment the minor version with any backwards-compatible changes to functionality, as well as any changes to preview functionality in the GitHub API. GitHub makes no guarantee about the stability of preview functionality, so neither do we consider it a stable part of the go-github API.
  • We increment the patch version with any backwards-compatible bug fixes.

Preview functionality may take the form of entire methods or simply additional data returned from an otherwise non-preview method. Refer to the GitHub API documentation for details on preview functionality.

License

This library is distributed under the BSD-style license found in the LICENSE file.

Issues
  • Drain Response.Body to enable TCP/TLS connection reuse (4x speedup)

    Drain Response.Body to enable TCP/TLS connection reuse (4x speedup)

    On successful queries (on errors ReadAll runs in CheckResponse), the Response.Body is not read all the way to the EOF as json.Decoder is used, which stops at the end of the object, which is probably followed by a \n.

    Then, Response.Body.Close() is called. When that happens with a non-drained Body, the TCP/TLS connection is closed (which makes sense, in case there was still a lot to read from the network), stopping the Transport from reusing it. Also, a library user can't drain the Body themselves because Close() is called before passing the Response to the user.

    Since we know GitHub API responses only carry a single JSON object, draining before closing is free, and saving all those handshakes causes huge savings in latency, bandwidth and CPU for both the client and the poor GitHub servers.

    Here's the result of running the benchmark below on a ADSL connection:

    before: 2m3.001599093s
    after: 33.753543928s
    
    func main() {
        ts := oauth2.StaticTokenSource(
            &oauth2.Token{AccessToken: os.Getenv("GITHUB_TOKEN")},
        )
        tc := oauth2.NewClient(oauth2.NoContext, ts)
        gh := github.NewClient(tc)
        start := time.Now()
        for i := 0; i < 100; i++ {
            gh.Repositories.Get("FiloSottile", "gvt")
            fmt.Print(".")
        }
        fmt.Printf("\n%s\n", time.Now().Sub(start))
    }
    
    opened by FiloSottile 34
  • Consistent Go naming for JSON fields

    Consistent Go naming for JSON fields

    As discussed in https://github.com/google/go-github/pull/520#discussion_r98727959 and https://github.com/google/go-github/pull/602#issuecomment-290255621 the naming of fields such as Total (as opposed to TotalCount) where the JSON name is total_count seems inconsistent and it would be nice to consolidate.

    However, this is a breaking API change.

    This issue has been opened to discuss the situation and see if it is worth breaking the API to have more consistency.

    enhancement good first issue 
    opened by gmlewis 29
  • int64 IDs

    int64 IDs

    On 32-bit platforms, a Go int is an int32.

    I worry about the use of int as the type for Github IDs in the go-github package.

    Is there documentation to suggest that Github IDs are limited to 2 billion items? Seems unlikely. But I can't find anything.

    I propose we keep "Number" fields as int, but change all the ID fields to be int64.

    Thoughts?

    /cc @gmlewis @willnorris @shurcooL

    enhancement NeedsFix 
    opened by bradfitz 29
  • Support `auto_merge` field in PullRequest struct

    Support `auto_merge` field in PullRequest struct

    The pulls API returns an auto_merge field which is currently not available in the PullRequest struct.

    When auto-merge is enabled for a Pull-Request the returned auto_merge field looks like:

      "auto_merge": {
        "enabled_by": {
          "login": "fho",
          "id": 514535,
          "node_id": "MDQ6VXNlcjUxNDUzNQ==",
          "avatar_url": "https://avatars.githubusercontent.com/u/514535?v=4",
          "gravatar_id": "",
          "url": "https://api.github.com/users/fho",
          "html_url": "https://github.com/fho",
          "followers_url": "https://api.github.com/users/fho/followers",
          "following_url": "https://api.github.com/users/fho/following{/other_user}",
          "gists_url": "https://api.github.com/users/fho/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/fho/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/fho/subscriptions",
          "organizations_url": "https://api.github.com/users/fho/orgs",
          "repos_url": "https://api.github.com/users/fho/repos",
          "events_url": "https://api.github.com/users/fho/events{/privacy}",
          "received_events_url": "https://api.github.com/users/fho/received_events",
          "type": "User",
          "site_admin": false
        },
        "merge_method": "rebase",
        "commit_title": "",
        "commit_message": ""
      },
    

    It would be great if go-github could parse this field and make it accessible.

    enhancement good first issue 
    opened by fho 28
  • Add function for PullRequestService to download raw content of pull r…

    Add function for PullRequestService to download raw content of pull r…

    …equest

    We already has an issue here https://github.com/google/go-github/issues/6 And as @willnorris said it's better to use Contents API to download, but Contents API seems to support blob or file content which is a part of a repository git tree only. (not include pull request)

    I want to support patch/diff media type in pull request also (which may not be supported even in future release). So i added method GetRaw to PullRequestService separate from original Get method (to maintain backward compatibility)

    opened by huydx 27
  • #720 Initial commit for listing Plans and Plan Accounts

    #720 Initial commit for listing Plans and Plan Accounts

    • Includes basic testing for Listing Plans and the Accounts linked to a Plan (including stubs)

    NOTE This is currently awaiting scrutiny as it's my first contribution to the project. I would appreciate any feedback (good or bad) and the 👍 if it's ok to carry on with the rest of the implementation for #720

    cla: yes 
    opened by lackerman 26
  • Update integration tests for new branch protection API.

    Update integration tests for new branch protection API.

    Integration tests update branches were broken since old structures were used. This has been modified. Integration folder requires ProtectionRequest structure to be available by RepositoryService. Protection also has been changed.

    Resolves #507. Updates #310.

    opened by varadarajana 26
  • github actions date not getting parsed by go-github

    github actions date not getting parsed by go-github

    github actions log:

    19:45:30 main.go:110: parsing time ""8/18/2019 7:44:51 PM"" as ""2006-01-02T15:04:05Z07:00"": cannot parse "/2019 7:44:51 PM"" as "2006"
    ##[error]Docker run failed with exit code 1
    

    this is on line 110, github.ParseWebHook , it's working with any other payload if I just use it from a regular curl command. but it's failing when used with GithubActions.

    data, err := ioutil.ReadFile(cmClient.inputFilePath)
    if err != nil {
    	log.Fatalln(err)
    }
    // Parsing event.json.
    event, err := github.ParseWebHook("issue_comment", data)
    if err != nil {
    	log.Fatalln(err)
    }
    

    data == issue_comment payload

    not sure if this is a github action issue or go-github issue. how can i help to resolve this?

    opened by geekodour 25
  • Support preview Installations API - updated routes for adding or removing a repository

    Support preview Installations API - updated routes for adding or removing a repository

    GitHub Developers announcment: https://developer.github.com/changes/2017-06-30-installations-adding-removing-a-repository/

    GitHub API docs: https://developer.github.com/v3/apps/installations/#add-repository-to-installation

    enhancement good first issue 
    opened by gmlewis 22
  • versioning and tagging releases

    versioning and tagging releases

    We generally try not to have egregious breaking changes in this library, but we're also not afraid to do them when necessary (the latest example being #375). We've gotten a couple of people asking for us to use semver on google/go-querystring#11, which we could also consider doing here.

    That doesn't help us for #375, but would allow us to do future breaking changes at a version boundary. I have no intention of changing the import path to use gopkg.in or anything like it, but it would still help set appropriate expectations for folks when they do upgrade to a new version. And keeping a CHANGELOG.md file might be nice (although a bit of work to keep up to date) to point out new APIs that we support, etc.

    @gmlewis @shurcooL what do you think?

    opened by willnorris 22
  • not able to activate advanced security

    not able to activate advanced security

    Forgive my naivety as an amateur developer, especially in go.

    I am trying to use Repositories.Edit to update the SecurityAndAnalysis.AdvancedSecurity.Status to enabled and even though I get 200 status, I receive an empty response. The field does not update as expected.

    The response body appears to not have the field available, which is probably the issue.

    I am definitely able to see the status of the field, using SecurityAndAnalysis.GetAdvancedSecurity()

    Does anyone know what I may be doing wrong or if this is maybe a bug somewhere? Thanks in advance!

    opened by dustincrogers 21
  • Additional options available for pull request reviews / branch protection rules

    Additional options available for pull request reviews / branch protection rules

    One such rule that is currently not supported is bypass_pull_request_allowances (https://docs.github.com/en/rest/branches/branch-protection#update-pull-request-review-protection)

    The library should be updated to include additional fields.

    I'm more than happy to take a stab at doing this myself as a first contribution, just using this Issue to document the request.

    opened by Starttoaster 1
  • PushEvent GetCommits() Method

    PushEvent GetCommits() Method

    I would like to use an interface for this event in a local implementation, but unfortunately a getter for this type doesn't exist. Can we create a getter for PushEvent.GetCommits?

    type PushEvent struct {
    ...
    Commits      []*HeadCommit
    ...
    }
    
    func (p *PushEvent) GetCommits() []*HeadCommit {
        return p.Commits
    }
    
    opened by midnightconman 2
Releases(v45.2.0)
  • v45.2.0(Jun 21, 2022)

    This minor release includes these changes:

    • Add Actor field to WorkflowRun (#2381)
    • Bump github.com/google/go-github/v45 from 45.0.0 to 45.1.0 in /scrape (#2382)
    • docs fix: correct a comment (#2383)
    • Add missing common event fields (#2384)
    • Add RoleName field to User struct (#2386)
    • Add support for repo setting use_squash_pr_title_as_default (#2390)
    • Add MembersCanForkPrivateRepositories field to Organization struct (#2389)
    Source code(tar.gz)
    Source code(zip)
  • v45.1.0(Jun 7, 2022)

  • v45.0.0(May 25, 2022)

    This release contains the following breaking API changes:

    • Support query parameter visible_to_repository in ListOrganizationRunnerGroups (#2329)

    and the following additional changes:

    • Add missing Sender field in RepositoryVulnerabilityAlertEvent (#2365)
    • Add support to sync a fork branch with the upstream repository. (#2337)
    • Add fields to RateLimits struct (#2340)
    • Add ReRequestCheckRun (#2358)
    • Add 'repository_import' event (#2364)
    • Bump golangci/golangci-lint-action from 3.1.0 to 3.2.0 (#2366)
    • Bump github.com/google/go-github/v44 from 44.0.0 to 44.1.0 in /scrape (#2367)
    • update-urls: update sidebar child articles links (#2369)
    • fix: correct endpoints for custom roles (#2370)
    • Update URLs (#2373)
    Source code(tar.gz)
    Source code(zip)
  • v44.1.0(May 13, 2022)

    This minor release contains the following changes:

    • Update scrape dependency to v44 (#2352)
    • Add a "Webhooks" section to the README.md (#2353)
    • Add support for list Code Scan Alerts by Org (#2346)
    • Bump github.com/google/go-cmp from 0.5.7 to 0.5.8 in /update-urls (#2354)
    • Bump github.com/google/go-cmp from 0.5.7 to 0.5.8 (#2355)
    • Bump github.com/google/go-cmp from 0.5.7 to 0.5.8 in /scrape (#2356)
    • Add RerunFailedJobsByID and RerunJobByID (#2345)
    Source code(tar.gz)
    Source code(zip)
  • v44.0.0(Apr 30, 2022)

    This release contains the following breaking API changes:

    • Deprecate WebHookPayload #2032

    and the following additional changes:

    • Update scrape dependency to v43 #2308
    • Add repo webhook redelivery method #2305
    • Add security-advisory and code-scanning-alert event types #2311
    • Bump actions/checkout from 2 to 3 #2314
    • Move examples dir into its own Go module #2310
    • Add AllowUpdateBranch to the Repository struct #2313
    • Bump actions/cache from 2 to 3 #2316
    • Add support for setting actions permissions on a repository #2315
    • Remove code duplication #2321
    • Improve stringify test coverage #2320
    • Clean up method return consistency #2318
    • Make auto-generated files read-only #2323
    • Update workflow to use Go 1.18 and Go 1.17 #2322
    • Add support for the pull request review thread event #2326
    • Bump actions/setup-go from 2 to 3 #2332
    • Bump codecov/codecov-action from 2.1.0 to 3 #2331
    • Add create repository with an initial commit with empty README #2333
    • Restrict permissions for GitHub actions #2334
    • Add support to list custom roles for organizations #2336
    • Bump codecov/codecov-action from 3.0.0 to 3.1.0 #2343
    • example: update go modules for some examples bbfb105
    • fix gofmt issue in newreposecretwithxcrypto 97b5d95
    • run golangci-lint on all modules c071ded
    Source code(tar.gz)
    Source code(zip)
  • v43.0.0(Mar 2, 2022)

    This release contains the following breaking API changes:

    • Add list options support for environments #2258
    • GitHub Actions Billing returns total_paid_minutes_used as float64 #2284
    • Fix RequireCodeOwnerReviews and RequiredApprovingReviewCount fields with omitempty #2289

    and the following additional changes:

    • Update scrape dependency to v42 #2254
    • Add AllowForking to Repository struct #2256
    • Bump github.com/bradleyfalzon/ghinstallation/v2 from 2.0.3 to 2.0.4 #2259
    • Update docs for CreateWorkflowDispatchEventRequest.Ref #2263
    • Add support for additional PagesUpdate parameters #2266
    • Bump github.com/google/go-cmp from 0.5.6 to 0.5.7 #2269
    • Bump github.com/google/go-cmp from 0.5.6 to 0.5.7 in /update-urls #2270
    • Bump github.com/google/go-cmp from 0.5.6 to 0.5.7 in /scrape #2271
    • ci: bump golangci-lint version #2272
    • Add checks field to RequiredStatusChecks #2276
    • Add Repo and Org fields to DeployKeyEvent #2280
    • Add support for the secret scanning API #2281
    • Add SecretScanningAlertEvent Webhook #2282
    • Add GetWorkflowRunAttempt #2290
    • Add APIMeta fields related to SSH keys #2293
    • Don't update the ratelimits if we got a response from a cache #2273
    • Revert "Remove graduated GitHub v3 API preview header" #2301
    • Bump golangci/golangci-lint-action from 2.5.2 to 3.1.0 #2303
    Source code(tar.gz)
    Source code(zip)
  • v42.0.0(Jan 13, 2022)

    This release contains the following breaking API changes:

    • ProjectOptions (public to private) & Project struct (org related fields) fixes #2111
    • Change type of HookDelivery.InstallationID to Int64. #2235
    • Add pagination options to list all package versions #2250

    and the following additional changes:

    • Update scrape dependency to v41 #2212
    • Adds test-cases for JSON resources marshaling #2176
    • Add CodeScanningService.ListAnalysesForRepo and CodeScanningService.GetAnalysis #2210
    • Handle protection status errors for unprotected branches #2092
    • Update GitHub Pages API to add new response parameters #2109
    • Add BranchProtectionRuleEvent Installation field #2216
    • Fix since+page pagination bug #2218
    • build: upgrade go directive in go.mod to 1.17 #2219
    • fix references to webhook types #2224
    • Update comment on ListPullRequestsWithCommit API #2228
    • Fix secondary rate limits URL and improve related documentation #2229
    • Add Changes field to RepositoryEvent #2233
    • Add app hook deliveries API #2226
    • Add support for External Groups #2217
    • Add PreviousAttemptURL, RunAttempt, RunStartedAt field to WorkflowRun #2238
    • Add new fields to WorkflowRun #2237
    • Update .gitignore for ignoring goenv .go-version file #2242
    • add team.html_url #2244
    • Update ListCheckRunsOptions with new field AppID #2236
    • adding examples for app auth #2240
    • Support Discussions webhook event #2221
    • Add DiscussionEvent webhook (google#2221) #2230
    • Add support for Dependabot secrets #2248
    Source code(tar.gz)
    Source code(zip)
  • v41.0.0(Nov 29, 2021)

    This release contains the following breaking API changes:

    • Change StorageBilling.EstimatedPaidStorageForMonth from int to float64 (#2205)

    and the following additional changes:

    • Add support for creating reaction for a release (#2196)
    • Parse Before/After Links into Response (#2154)
    • Add missing attribute job_runs in WorkflowRunBill (#2206)
    • Add function to delete a workflow run by ID (#2207)
    • Handle 'since' in addition to 'page' for pagination response (#2135)
    • Add active committers API implementation (#2208)
    Source code(tar.gz)
    Source code(zip)
  • v40.0.0(Nov 8, 2021)

    This release contains the following breaking API changes:

    • runnerID and runnerGroupID are int64, not string (#2127)

    and the following additional changes:

    • Bump github.com/google/go-github/v39 from 39.1.0 to 39.2.0 in /scrape (#2126)
    • Audit log query options set should contain url tag (#2128)
    • Fix user packages api path (#2129)
    • Add runner info to workflow job object (#2131)
    • Support GitHub Advanced Security repository settings (#2133)
    • Fix API links in actions_artifacts.go (#2141)
    • Bump github.com/PuerkitoBio/goquery from 1.7.1 to 1.8.0 in /scrape (#2193)
    • Add new RemoveMilestone method on IssuesService (#2195)
    • Add RenameBranch support (#2119)
    • Add missing fields to Timeline (#2197)
    • Add method to upload Code Scanning Sarif Analysis results to GitHub (#2165)

    plus several test- or documentation-only changes.

    Source code(tar.gz)
    Source code(zip)
  • v39.2.0(Oct 13, 2021)

    This minor release contains the following changes:

    • Add support for workflow_job event's labels field (#2103)
    • Fix linters issues (#2104)
    • Add support for Packages API (#2076)
    • Fix new golangci-lint errors (#2105)
    • Bump CI version of Go to test versions 1.17.x and 1.16.x (#2108)
    • Add support for apps webhook config endpoints (#2096)
    • Add Organization to PushEvent and IssueCommentEvent (#2116)
    • Remove outdated comment for #540 (#2117)
    • Bump scrape apps to google/go-github v39 (#2121)
    • Support specifying repository names (#2123)
    • Add generate release notes support (#2114)
    Source code(tar.gz)
    Source code(zip)
  • v39.1.0(Sep 23, 2021)

    This minor release contains the following changes:

    • Add test cases to verify that error responses contain status code (#2093)
    • Bump codecov/codecov-action from 2.0.3 to 2.1.0 (#2094)
    • Add common Installation field to webhook events (#2101)
    • Add pagination fields to code scanning (#2100)
    • Add BranchProtectionRuleEvent (#2102)
    Source code(tar.gz)
    Source code(zip)
  • v39.0.0(Sep 9, 2021)

    This release contains the following breaking API changes:

    • Add List Options for ListRepositoryAccessRunnerGroup #2086

    and the following additional changes:

    • Update Cursor comment to reference an existing method #2042
    • Add raw_key field to GPGKey struct #2043
    • Upgrade crypto and net dependencies #2045
    • Set up workflow for golangci #2020
    • chore(ci) : cache go-build folders #2054
    • Bump styfle/cancel-workflow-action from 0.9.0 to 0.9.1 #2049
    • Fix update-urls unit tests broken by #1875 #2058
    • Bump codecov/codecov-action from 2.0.2 to 2.0.3 #2065
    • Introduce the auto merge property #2074
    • Add support for autolinks #2046
    • Implement SCIM #2062
    • Add function for redelivering webhooks #2061
    • Add struct for workflow_job event #2038
    • Add created field to ListWorkflowRunsOptions #2083
    • Update repo community profile API #2084

    plus several test- or documentation-only changes.

    Source code(tar.gz)
    Source code(zip)
  • v38.1.0(Aug 12, 2021)

    This release contains the following non-breaking-API change:

    • Allow empty selected_repository_ids for SetSelectedReposForOrgSecret (#2036)

    and the following documentation-only change:

    • Fix GitHub docs links (#2039)
    Source code(tar.gz)
    Source code(zip)
  • v38.0.0(Aug 11, 2021)

    This release contains the following breaking API changes:

    • Add ListOptions to GetCommit and CompareCommits to support pagination (#1960)
    • Fix deprecated state/open field (#2017)

    and the following additional changes:

    • Add RequiredConversationResolution ProtectionRequest field (#1959)
    • Add missing CreatedAt and UpdatedAt fields to CheckSuite. (#1983)
    • Add support for listing and getting repository/organization webhook deliveries (#1934)
    • Expose event message headers, introduce a new way to read the body from an io.Reader (#1955)
    • Add allows_public_repositories to actions_runner_group (#1998)
    • Add methods to add and remove repos for actions on org level (#1997)
    • Add new GitHub code scanning Alert fields (#2013)
    • Add Client method (#2016)
    • Add avatar_url field to RepoStatus (#2021)
    • Add Slug field to AppConfig (#2029)
    • Add TokenExpiration to Response (#2031)

    plus the following test- or documentation-only changes:

    • Add test cases for JSON resource marshaling (#1961)
    • Add test cases for JSON resource marshaling (#1965)
    • Add test cases for JSON resource marshaling (#1966)
    • Add test cases for JSON resource marshaling (#1967)
    • Add test cases for JSON resource marshaling (#1968)
    • Add test cases for JSON resource marshaling (#1969)
    • Add test cases for JSON resource marshaling (#1970)
    • Add test cases for JSON resource marshaling (#1971)
    • Add test cases for JSON resource marshaling (#1972)
    • Add test cases for JSON resource marshaling (#1973)
    • Add test cases for JSON resource marshaling (#1974)
    • Add test cases for JSON resource marshaling (#1975)
    • Add test cases for JSON resource marshaling (#1976)
    • Add test cases for JSON resource marshaling (#1977)
    • Add test cases for JSON resource marshaling (#1978)
    • Add test cases for JSON resource marshaling (#1979)
    • Add test cases for JSON resource marshaling (#1981)
    • Add test cases for JSON resource marshaling (#1982)
    • Add test cases for JSON resource marshaling (#1984)
    • Add test cases for JSON resource marshaling (#1985)
    • Add test cases for JSON resource marshaling (#1986)
    • Add test cases for JSON resource marshaling (#1987)
    • Add test cases for JSON resource marshaling (#1988)
    • Add test cases for JSON resource marshaling (#1989)
    • Add test cases for JSON resource marshaling (#1990)
    • Add test cases for JSON resource marshaling (#1991)
    • Add test cases for JSON resource marshaling (#1992)
    • Add test cases for JSON resource marshaling (#1994)
    • Add test cases for JSON resource marshaling (#2000)
    • Add test cases for JSON resource marshaling (#2001)
    • Make test names consistent (#2002)
    • Add test cases for JSON resource marshaling (#2003)
    • Add test cases for JSON resource marshaling (#2004)
    • Make test names consistent (#2005)
    • Add test cases for JSON resource marshaling (#2006)
    • Add test cases for JSON resource marshaling (#2007)
    • Add test cases for JSON resource marshaling (#2009)
    • Add test cases for JSON resource marshaling (#2010)
    • Add test cases for JSON resource marshaling (#2011)
    • Update AUTHORS with recent contributors (#2012)
    • Add test cases for JSON resource marshaling (#2014)
    • Add mention to go-github-mock in README (#2025)
    • Use x crypto instead of sodium (#2034)
    Source code(tar.gz)
    Source code(zip)
  • v37.0.0(Jul 9, 2021)

    This release contains the following breaking API changes:

    • define struct types instead of using anonymous structs #1900
    • Modify GetBranch to handle redirects #1901
    • Fix Code Scanning Alert tool field #1904

    and the following additional changes:

    • Parse 'reviewed' event object 'state' property #1886
    • Add auto_merge field in PullRequest struct #1896
    • Repository Vulnerability Alert Add Missing Fields #1898
    • Enable Client.RateLimits to bypass the rate limit check #1907
    • Handle MIME parameters in Content-Type Header #1922
    • Add RequiredConversationResolution protection field #1946
    • Repository Object - Deprecated Fields #1952

    plus the following test-only changes:

    • Add test cases for JSON resource marshaling #1902
    • Add test cases for JSON resource marshaling #1906
    • Add test cases for JSON resource marshaling #1908
    • Add test cases for JSON resource marshaling #1909
    • Add test cases for JSON resource marshaling #1912
    • Add test cases for JSON resource marshaling #1913
    • Add test cases for JSON resource marshaling #1914
    • Add test cases for JSON resource marshaling #1915
    • Add test cases for JSON resource marshaling #1917
    • Add test cases for JSON resource marshaling #1918
    • Add test cases for JSON resource marshaling #1919
    • Add test cases for JSON resource marshaling #1923
    • Add test cases for JSON resource marshaling #1924
    • Add test cases for JSON resource marshaling #1925
    • Add test cases for JSON resource marshaling #1926
    • Add test cases for JSON resource marshaling #1927
    • Add test cases for JSON resource marshaling #1928
    • Add test cases for JSON resource marshaling #1929
    • Add test cases for JSON resource marshaling #1930
    • Add test cases for JSON resource marshaling #1937
    • Add test cases for JSON resource marshaling #1938
    • Add test for JSON marshaling for Teams #1941
    • Add test cases for JSON resource marshaling #1951
    Source code(tar.gz)
    Source code(zip)
  • v36.0.0(Jun 26, 2021)

    This release contains the following breaking API changes:

    • #1883
    • #1892

    and the following additional changes:

    • #1884
    • #1891
    • fix: typo in readme in word "parameters" https://github.com/google/go-github/commit/3c23f3ced9aa9c82995de556ac442c9e52df2fef
    • actions: use actions/[email protected] https://github.com/google/go-github/commit/77dd0eb64ad232f78c67fd86fe4b84be887bab5b
    • #1910
    • #1911
    Source code(tar.gz)
    Source code(zip)
  • v35.3.0(Jun 6, 2021)

    This release contains the following changes since v35.2.0:

    • Add missing fields to Star event (#1869) …
    • Support map type in go generate (#1867) …
    • Add support for the list failed organization invitations feature (#1871) …
    • Change all *map to map in JSON structs (#1870) …
    • Fix typo in repos.go (#1873)
    • fix: Updated comparisons in test files (#1875) …
    • compare decoded go struct for request body (#1876)
    • Add missing installation permissions (#1880) …
    Source code(tar.gz)
    Source code(zip)
  • v35.2.0(May 6, 2021)

    This release contains the following changes since v35.1.0:

    • https://github.com/google/go-github/pull/1858
    • https://github.com/google/go-github/pull/1860
    • https://github.com/google/go-github/pull/1862
    • https://github.com/google/go-github/pull/1864
    Source code(tar.gz)
    Source code(zip)
  • v35.1.0(Apr 24, 2021)

    This release contains the following changes since v35.0.0:

    • https://github.com/google/go-github/pull/1853
    • https://github.com/google/go-github/pull/1854
    • https://github.com/google/go-github/pull/1856
    • https://github.com/google/go-github/commit/94d2fbbfba4de5018c7b19da5bc99aa1e9769f2c
    • https://github.com/google/go-github/pull/1857
    Source code(tar.gz)
    Source code(zip)
  • v35.0.0(Apr 14, 2021)

    This release contains the following breaking API changes:

    • #1827
    • #1838

    and the following additional changes:

    • #1836
    • #1840
    • #1842
    • #1844
    • #1847
    • #1850
    Source code(tar.gz)
    Source code(zip)
  • v34.0.0(Mar 25, 2021)

  • v33.0.0(Dec 2, 2020)

    This release contains the following breaking API changes:

    • #1542
    • #1584
    • #1640
    • #1658

    Thank you to all the volunteers who help keep this repo up-to-date!

    Source code(tar.gz)
    Source code(zip)
  • v32.1.0(Jul 18, 2020)

    This release contains the following non-breaking changes since v32.0.0:

    • #1544
    • #1545
    • #1548
    • #1551
    • #1553
    • #1555
    • #1556
    • #1557
    • #1558
    • #1563
    • #1565
    • #1566
    • #1568
    • #1569
    • #1571

    Thank you to all the volunteers who help keep this repo up-to-date!

    Source code(tar.gz)
    Source code(zip)
  • v32.0.0(May 28, 2020)

    This release contains the following breaking API changes:

    • https://github.com/google/go-github/pull/1498
    • https://github.com/google/go-github/pull/1513
    • https://github.com/google/go-github/pull/1534
    • https://github.com/google/go-github/pull/1535

    Thank you to all the volunteers who help keep this repo up-to-date!

    Source code(tar.gz)
    Source code(zip)
  • v31.0.0(Apr 10, 2020)

  • v30.1.0(Mar 25, 2020)

  • v30.0.0(Mar 18, 2020)

    Release v30.0.0 incorporates a large number of breaking changes including the removal of many deprecated API endpoints, the renaming of methods, and some changes in types and method signatures.

    Source code(tar.gz)
    Source code(zip)
  • v29.0.3(Feb 10, 2020)

  • v29.0.2(Jan 10, 2020)

  • v29.0.1(Jan 9, 2020)

Go library for accessing the GitHub API

go-github go-github is a Go client library for accessing the GitHub API v3. Currently, go-github requires Go version 1.9 or greater. go-github tracks

Google 8.7k Aug 11, 2022
Go library for accessing trending repositories and developers at Github.

go-trending A package to retrieve trending repositories and developers from Github written in golang. This package were inspired by rochefort/git-tren

Andy Grunwald 121 Aug 2, 2022
Go library for accessing the MyAnimeList API: http://myanimelist.net/modules.php?go=api

go-myanimelist go-myanimelist is a Go client library for accessing the MyAnimeList API. Project Status The MyAnimeList API has been stable for years a

Stratos Neiros 31 May 10, 2022
A GoLang wrapper for Politics & War's API. Forego the hassle of accessing the API directly!

A GoLang wrapper for Politics & War's API. Forego the hassle of accessing the API directly!

null 1 Mar 5, 2022
Go library for accessing the Codeship API v2

Codeship API v2 Client for Go Codeship API v2 client for Go. Documentation https://godoc.org/github.com/codeship/codeship-go Usage go get -u github.co

CodeShip 18 Nov 15, 2021
Go library for accessing the Keycloak API

keycloak keycloak is a Go client library for accessing the Keycloak API. Installation go get github.com/zemirco/keycloak Usage package main import (

Mirco Zeiss 24 Jul 15, 2022
NotionGo is a Go client library for accessing the Notion API v1.

NotionGo (WIP) NotionGo is a Go client library for accessing the Notion API v1. Installation NotionGo is compatible with modern Go releases in module

Ben 4 May 22, 2021
go-ftx go-ftx is a Go client library for accessing the FTX API

go-ftx go-ftx is a Go client library for accessing the FTX API

Clouding 6 Jun 29, 2022
Go library for accessing the BlaBlaCar API

go-blablacar is a Go client library for accessing the BlaBlaCar API.

Midneit 3 Jul 27, 2021
Go(lang) client library for accessing information of an Apache Mesos cluster.

megos Go(lang) client library for accessing an Apache Mesos cluster. Features Determine the Mesos leader Get the current state of every mesos node (ma

Andy Grunwald 54 Jul 18, 2021
🤖🚀📦 A Discord Bot for accessing the cdnjs platform

A bridge between https://cdnjs.com/api and Discord Big shoutout to Br1ght0ne for helping me with writing helpers.go/SplitIn

Ilya Revenko 16 Nov 22, 2021
efsu is for accessing AWS EFS from your machine without a VPN

efsu: VPN-less access to AWS EFS efsu is for accessing AWS EFS from your machine without a VPN. It achieves this by deploying a Lambda function and sh

Glass Echidna 42 Mar 11, 2022
A GitHub CLI extension that displays collaboration-related information about a GitHub repository.

collab-scanner GitHub CLI extension A GitHub CLI extension that displays collaboration-related information on a repository. Install gh extension insta

Nicolas Kosinski 4 Jun 2, 2022
This project is mostly a fancy wrapper around the Extract Table (github) API

Knockout-City-Stat-Scanner Credits This project is mostly a fancy wrapper around the Extract Table (github) API, they did all the heavy lifting here a

Ricky Grassmuck 0 Jan 30, 2022
API Статистики пользователя GitHub 🐙

?? API статистики пользоватя GitHub ?? ???? English Version ???? Commits Request sample GET https://hud0shnikgitapi.herokuapp.com/commits/hud0shnik GE

Danila Egorov 7 Jun 22, 2022
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key

Simple Weather API Simple weather api app created using golang and Open Weather

Siva Prakash 3 Feb 6, 2022
go-whatsapp-rest-API is a Go library for the WhatsApp web which use Swagger as api interface

go-whatsapp-rest-API go-whatsapp-rest-API is a Go library for the WhatsApp web which use Swagger as api interface Multi-devices (MD) Support. This ver

null 16 May 13, 2022
:fishing_pole_and_fish: Webhook receiver for GitHub, Bitbucket, GitLab, Gogs

Library webhooks Library webhooks allows for easy receiving and parsing of GitHub, Bitbucket and GitLab Webhook Events Features: Parses the entire pay

Go Playgound 748 Aug 3, 2022
Periodically collect data about my Twitter account and check in to github to preserve an audit trail.

Twitter audit trail backup This repository backs up my follower list, following list, blocked accounts list and muted accounts list periodically using

Ahmet Alp Balkan 59 Aug 3, 2022