aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/google/go-github/github/git_tags.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/google/go-github/github/git_tags.go')
-rw-r--r--vendor/github.com/google/go-github/github/git_tags.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/vendor/github.com/google/go-github/github/git_tags.go b/vendor/github.com/google/go-github/github/git_tags.go
index 08df3d3..f3822ff 100644
--- a/vendor/github.com/google/go-github/github/git_tags.go
+++ b/vendor/github.com/google/go-github/github/git_tags.go
@@ -8,6 +8,7 @@ package github
import (
"context"
"fmt"
+ "strings"
)
// Tag represents a tag object.
@@ -19,6 +20,7 @@ type Tag struct {
Tagger *CommitAuthor `json:"tagger,omitempty"`
Object *GitObject `json:"object,omitempty"`
Verification *SignatureVerification `json:"verification,omitempty"`
+ NodeID *string `json:"node_id,omitempty"`
}
// createTagRequest represents the body of a CreateTag request. This is mostly
@@ -42,8 +44,9 @@ func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha
return nil, nil, err
}
- // TODO: remove custom Accept header when this API fully launches.
- req.Header.Set("Accept", mediaTypeGitSigningPreview)
+ // TODO: remove custom Accept headers when APIs fully launch.
+ acceptHeaders := []string{mediaTypeGitSigningPreview, mediaTypeGraphQLNodeIDPreview}
+ req.Header.Set("Accept", strings.Join(acceptHeaders, ", "))
tag := new(Tag)
resp, err := s.client.Do(ctx, req, tag)
@@ -72,6 +75,9 @@ func (s *GitService) CreateTag(ctx context.Context, owner string, repo string, t
return nil, nil, err
}
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
+
t := new(Tag)
resp, err := s.client.Do(ctx, req, t)
return t, resp, err