Skip to content

Commit

Permalink
feat: update module github.com/google/go-github/v67 to v68, add suppo…
Browse files Browse the repository at this point in the history
…rt for `project_v2` and `project_v2_item` events (#105)

* major(deps): update module github.com/google/go-github/v67 to v68

* deps: update to go-github v68

* feat: support project v2 events

* docs: update docs

* fix: regenerate files

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: cbrgm <[email protected]>
  • Loading branch information
renovate[bot] and cbrgm authored Dec 24, 2024
1 parent a09b5d3 commit 4cb5329
Show file tree
Hide file tree
Showing 112 changed files with 3,818 additions and 5,039 deletions.
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ package main
import (
"fmt"
"github.com/cbrgm/githubevents/githubevents"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"net/http"
)

Expand Down Expand Up @@ -220,11 +220,9 @@ handle.OnError(

* ***[ping](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#ping)***

* ***[project](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#project)***
* ***[project_v2](https://docs.github.com/en/webhooks/webhook-events-and-payloads#projects_v2)***

* ***[project_card](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#project_card)***

* ***[project_column](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#project_column)***
* ***[projects_v2_item](https://docs.github.com/en/webhooks/webhook-events-and-payloads#projects_v2_item)***

* ***[public](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#public)***

Expand Down Expand Up @@ -278,6 +276,7 @@ Alternatively, you can choose to build and manage a webhook through the Webhooks

| google/go-github | cbrgm/githubevents |
|------------------|--------------------|
| `v68.x` | `v1.21.x` |
| `v67.x` | `v1.20.x` |
| `v66.x` | `v1.19.x` |
| `v65.x` | `v1.18.x` |
Expand All @@ -290,13 +289,13 @@ Alternatively, you can choose to build and manage a webhook through the Webhooks
| `v58.x` | `v1.10.x` |
| `v56.x` | `v1.9.x` |
| `v50.x` | `v1.8.x` |
| `v49.x` | <= `v1.7.x` |
| `v48.x` | <=`v1.6.x` |
| `v47.x` | <=`v1.4.x` |
| `v46.x` | <=`v1.3.x` |
| `v45.x` | <=`v1.2.x` |
| `v44.x` | <=`v1.1.2x` |
| `v43.x` | <=`v1.1.1x` |
| `v49.x` | `v1.7.x` |
| `v48.x` | `v1.6.x` |
| `v47.x` | `v1.4.x` |
| `v46.x` | `v1.3.x` |
| `v45.x` | `v1.2.x` |
| `v44.x` | `v1.1.2x` |
| `v43.x` | `v1.1.1x` |

## Contributing & License

Expand Down
2 changes: 1 addition & 1 deletion examples/simple-http-server-packages/plugins/responder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/cbrgm/githubevents/githubevents"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
)

func NewResponder(msg string) githubevents.IssueCommentEventHandleFunc {
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-http-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"

"github.com/cbrgm/githubevents/githubevents"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
)

func main() {
Expand Down
45 changes: 15 additions & 30 deletions gen/template_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,8 @@ var params = TemplateParameters{
HasActions: false,
},
{
Event: "ProjectEvent",
Name: "project",
Event: "ProjectV2Event",
Name: "project_v2",
Actions: []Action{
{
Handler: "ProjectEventCreated",
Expand All @@ -574,51 +574,36 @@ var params = TemplateParameters{
HasActions: true,
},
{
Event: "ProjectCardEvent",
Name: "project_card",
Event: "ProjectV2ItemEvent",
Name: "project_v2_item",
Actions: []Action{
{
Handler: "ProjectCardEventCreated",
Handler: "ProjectItemEventCreated",
Action: "created",
},
{
Handler: "ProjectCardEventEdited",
Handler: "ProjectItemEventEdited",
Action: "edited",
},
{
Handler: "ProjectCardEventConverted",
Action: "converted",
Handler: "ProjectItemEventClosed",
Action: "closed",
},
{
Handler: "ProjectCardEventMoved",
Action: "moved",
Handler: "ProjectItemEventReopened",
Action: "reopened",
},
{
Handler: "ProjectCardEventDeleted",
Handler: "ProjectItemEventDeleted",
Action: "deleted",
},
},
HasActions: true,
},
{
Event: "ProjectColumnEvent",
Name: "project_column",
Actions: []Action{
{
Handler: "ProjectColumnEventCreated",
Action: "created",
},
{
Handler: "ProjectColumnEventEdited",
Action: "edited",
},
{
Handler: "ProjectColumnEventMoved",
Action: "moved",
Handler: "ProjectItemEventConverted",
Action: "converted",
},
{
Handler: "ProjectColumnEventDeleted",
Action: "deleted",
Handler: "ProjectItemEventRestored",
Action: "restored",
},
},
HasActions: true,
Expand Down
2 changes: 1 addition & 1 deletion gen/template_webhook_event_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package githubevents
import (
"errors"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"testing"
"sync"
)
Expand Down
2 changes: 1 addition & 1 deletion gen/template_webhook_event_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package githubevents
import (
"fmt"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"golang.org/x/sync/errgroup"
)
Expand Down
2 changes: 1 addition & 1 deletion gen/template_webook_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package githubevents
import (
"fmt"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"golang.org/x/sync/errgroup"
"net/http"
"sync"
Expand Down
18 changes: 7 additions & 11 deletions githubevents/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"fmt"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"golang.org/x/sync/errgroup"
"net/http"
"sync"
Expand Down Expand Up @@ -59,9 +59,8 @@ type EventHandler struct {
onPackageEvent map[string][]PackageEventHandleFunc
onPageBuildEvent map[string][]PageBuildEventHandleFunc
onPingEvent map[string][]PingEventHandleFunc
onProjectEvent map[string][]ProjectEventHandleFunc
onProjectCardEvent map[string][]ProjectCardEventHandleFunc
onProjectColumnEvent map[string][]ProjectColumnEventHandleFunc
onProjectV2Event map[string][]ProjectV2EventHandleFunc
onProjectV2ItemEvent map[string][]ProjectV2ItemEventHandleFunc
onPublicEvent map[string][]PublicEventHandleFunc
onPullRequestEvent map[string][]PullRequestEventHandleFunc
onPullRequestReviewEvent map[string][]PullRequestReviewEventHandleFunc
Expand Down Expand Up @@ -388,14 +387,11 @@ func (g *EventHandler) HandleEventRequest(req *http.Request) error {
case *github.PingEvent:
return g.PingEvent(deliveryID, eventName, event)

case *github.ProjectEvent:
return g.ProjectEvent(deliveryID, eventName, event)
case *github.ProjectV2Event:
return g.ProjectV2Event(deliveryID, eventName, event)

case *github.ProjectCardEvent:
return g.ProjectCardEvent(deliveryID, eventName, event)

case *github.ProjectColumnEvent:
return g.ProjectColumnEvent(deliveryID, eventName, event)
case *github.ProjectV2ItemEvent:
return g.ProjectV2ItemEvent(deliveryID, eventName, event)

case *github.PublicEvent:
return g.PublicEvent(deliveryID, eventName, event)
Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_branch_protection_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"fmt"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"golang.org/x/sync/errgroup"
)

Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_branch_protection_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"errors"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"sync"
"testing"
)
Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_check_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"fmt"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"golang.org/x/sync/errgroup"
)

Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_check_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"errors"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"sync"
"testing"
)
Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_check_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"fmt"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"golang.org/x/sync/errgroup"
)

Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_check_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"errors"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"sync"
"testing"
)
Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_commit_comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"fmt"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"golang.org/x/sync/errgroup"
)

Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_commit_comment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"errors"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"sync"
"testing"
)
Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"fmt"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"golang.org/x/sync/errgroup"
)

Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"errors"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"sync"
"testing"
)
Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"fmt"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"golang.org/x/sync/errgroup"
)

Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"errors"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"sync"
"testing"
)
Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_deploy_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"fmt"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"golang.org/x/sync/errgroup"
)

Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_deploy_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"errors"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"sync"
"testing"
)
Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"fmt"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"golang.org/x/sync/errgroup"
)

Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_deployment_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"fmt"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"golang.org/x/sync/errgroup"
)

Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_deployment_status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"errors"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"sync"
"testing"
)
Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"errors"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"sync"
"testing"
)
Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_discussion.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"fmt"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"golang.org/x/sync/errgroup"
)

Expand Down
2 changes: 1 addition & 1 deletion githubevents/events_discussion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package githubevents

import (
"errors"
"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"sync"
"testing"
)
Expand Down
Loading

0 comments on commit 4cb5329

Please sign in to comment.