diff options
author | 6543 <6543@obermui.de> | 2023-05-31 02:31:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-31 00:31:51 +0000 |
commit | 4c81dae2977b1723330459be754649c6a3080129 (patch) | |
tree | a93785a179da5b9c766572cdbdd43150e34932a7 /services/migrations | |
parent | 0c79a655d42dabc0eb2941efbc44548716fe6913 (diff) | |
download | gitea-4c81dae2977b1723330459be754649c6a3080129.tar.gz gitea-4c81dae2977b1723330459be754649c6a3080129.zip |
Update github.com/google/go-github to v52 (#24004)
based on https://github.com/google/go-github/pull/2743
because of
https://github.com/go-gitea/gitea/pull/23946#discussion_r1160317554
---------
Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'services/migrations')
-rw-r--r-- | services/migrations/error.go | 2 | ||||
-rw-r--r-- | services/migrations/github.go | 19 |
2 files changed, 7 insertions, 14 deletions
diff --git a/services/migrations/error.go b/services/migrations/error.go index 5f0388a497..a89105a007 100644 --- a/services/migrations/error.go +++ b/services/migrations/error.go @@ -7,7 +7,7 @@ package migrations import ( "errors" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" ) // ErrRepoNotCreated returns the error that repository not created diff --git a/services/migrations/github.go b/services/migrations/github.go index ca6e037b68..cc8bb53407 100644 --- a/services/migrations/github.go +++ b/services/migrations/github.go @@ -20,7 +20,7 @@ import ( "code.gitea.io/gitea/modules/proxy" "code.gitea.io/gitea/modules/structs" - "github.com/google/go-github/v51/github" + "github.com/google/go-github/v52/github" "golang.org/x/oauth2" ) @@ -256,11 +256,11 @@ func (g *GithubDownloaderV3) GetMilestones() ([]*base.Milestone, error) { milestones = append(milestones, &base.Milestone{ Title: m.GetTitle(), Description: m.GetDescription(), - Deadline: convertGithubTimestampToTime(m.DueOn), + Deadline: m.DueOn.GetTime(), State: state, Created: m.GetCreatedAt().Time, - Updated: convertGithubTimestampToTime(m.UpdatedAt), - Closed: convertGithubTimestampToTime(m.ClosedAt), + Updated: m.UpdatedAt.GetTime(), + Closed: m.ClosedAt.GetTime(), }) } if len(ms) < perPage { @@ -715,11 +715,11 @@ func (g *GithubDownloaderV3) GetPullRequests(page, perPage int) ([]*base.PullReq State: pr.GetState(), Created: pr.GetCreatedAt().Time, Updated: pr.GetUpdatedAt().Time, - Closed: convertGithubTimestampToTime(pr.ClosedAt), + Closed: pr.ClosedAt.GetTime(), Labels: labels, Merged: pr.MergedAt != nil, MergeCommitSHA: pr.GetMergeCommitSHA(), - MergedTime: convertGithubTimestampToTime(pr.MergedAt), + MergedTime: pr.MergedAt.GetTime(), IsLocked: pr.ActiveLockReason != nil, Head: base.PullRequestBranch{ Ref: pr.GetHead().GetRef(), @@ -878,10 +878,3 @@ func (g *GithubDownloaderV3) GetReviews(reviewable base.Reviewable) ([]*base.Rev } return allReviews, nil } - -func convertGithubTimestampToTime(t *github.Timestamp) *time.Time { - if t == nil { - return nil - } - return &t.Time -} |