Repository: google/go-github (go)

Issue:
ProjectCard is not supported for issue timeline
Project card fields from the starfox preview was added for IssueEvent (https://github.com/google/go-github/pull/1066/files). It's still not present for issue timeline though.

See https://developer.github.com/v3/issues/timeline/#list-events-for-an-issue

Pull request description:
IssueTimeline: Support Project Card fields
This PR adds `ProjectCard` field into `Timeline`.
Closes #1091.

Patch:
diff --git a/github/github-accessors.go b/github/github-accessors.go
index fe3de66c..658cad2a 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -11244,6 +11244,14 @@ func (t *Timeline) GetMilestone() *Milestone {
 	return t.Milestone
 }
 
+// GetProjectCard returns the ProjectCard field.
+func (t *Timeline) GetProjectCard() *ProjectCard {
+	if t == nil {
+		return nil
+	}
+	return t.ProjectCard
+}
+
 // GetRename returns the Rename field.
 func (t *Timeline) GetRename() *Rename {
 	if t == nil {
diff --git a/github/issues_timeline.go b/github/issues_timeline.go
index 9cfda832..5987bd06 100644
--- a/github/issues_timeline.go
+++ b/github/issues_timeline.go
@@ -8,6 +8,7 @@ package github
 import (
 	"context"
 	"fmt"
+	"strings"
 	"time"
 )
 
@@ -115,7 +116,8 @@ type Timeline struct {
 	Source *Source `json:"source,omitempty"`
 	// An object containing rename details including 'from' and 'to' attributes.
 	// Only provided for 'renamed' events.
-	Rename *Rename `json:"rename,omitempty"`
+	Rename      *Rename      `json:"rename,omitempty"`
+	ProjectCard *ProjectCard `json:"project_card,omitempty"`
 }
 
 // Source represents a reference's source.
@@ -141,7 +143,8 @@ func (s *IssuesService) ListIssueTimeline(ctx context.Context, owner, repo strin
 	}
 
 	// TODO: remove custom Accept header when this API fully launches.
-	req.Header.Set("Accept", mediaTypeTimelinePreview)
+	acceptHeaders := []string{mediaTypeTimelinePreview, mediaTypeProjectCardDetailsPreview}
+	req.Header.Set("Accept", strings.Join(acceptHeaders, ", "))
 
 	var events []*Timeline
 	resp, err := s.client.Do(ctx, req, &events)


Test patch:
diff --git a/github/issues_events_test.go b/github/issues_events_test.go
index fe21ecbe..17d6ac3d 100644
--- a/github/issues_events_test.go
+++ b/github/issues_events_test.go
@@ -10,6 +10,7 @@ import (
 	"fmt"
 	"net/http"
 	"reflect"
+	"strings"
 	"testing"
 )
 
@@ -17,8 +18,10 @@ func TestIssuesService_ListIssueEvents(t *testing.T) {
 	client, mux, _, teardown := setup()
 	defer teardown()
 
+	wantAcceptHeaders := []string{mediaTypeLockReasonPreview, mediaTypeProjectCardDetailsPreview}
 	mux.HandleFunc("/repos/o/r/issues/1/events", func(w http.ResponseWriter, r *http.Request) {
 		testMethod(t, r, "GET")
+		testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", "))
 		testFormValues(t, r, values{
 			"page":     "1",
 			"per_page": "2",
diff --git a/github/issues_timeline_test.go b/github/issues_timeline_test.go
index 93f62368..4d0a41bb 100644
--- a/github/issues_timeline_test.go
+++ b/github/issues_timeline_test.go
@@ -10,6 +10,7 @@ import (
 	"fmt"
 	"net/http"
 	"reflect"
+	"strings"
 	"testing"
 )
 
@@ -17,9 +18,10 @@ func TestIssuesService_ListIssueTimeline(t *testing.T) {
 	client, mux, _, teardown := setup()
 	defer teardown()
 
+	wantAcceptHeaders := []string{mediaTypeTimelinePreview, mediaTypeProjectCardDetailsPreview}
 	mux.HandleFunc("/repos/o/r/issues/1/timeline", func(w http.ResponseWriter, r *http.Request) {
 		testMethod(t, r, "GET")
-		testHeader(t, r, "Accept", mediaTypeTimelinePreview)
+		testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", "))
 		testFormValues(t, r, values{
 			"page":     "1",
 			"per_page": "2",