diff --git a/plugins/github/README.md b/plugins/github/README.md index b3ec040b..17db6b49 100644 --- a/plugins/github/README.md +++ b/plugins/github/README.md @@ -70,6 +70,7 @@ All of the webhooks are deleted when the plugin event source gets closed (i.e. w | `github.repo` | `string` | None | (deprecated) URL of the git repository where the event occurred. Github Webhook payloads contain the repository property when the event occurs from activity in a repository. | | `github.repo.url` | `string` | None | URL of the git repository where the event occurred. Github Webhook payloads contain the repository property when the event occurs from activity in a repository. | | `github.repo.name` | `string` | None | Name of the git repository where the event occurred. Github Webhook payloads contain the repository property when the event occurs from activity in a repository. | +| `github.repo.description` | `string` | None | Description of the git repository where the event occurred. | | `github.org` | `string` | None | Name of the organization the git repository belongs to. | | `github.owner` | `string` | None | Name of the repository's owner. | | `github.repo.public` | `string` | None | 'true' if the repository affected by the action is public. 'false' otherwise. | diff --git a/plugins/github/pkg/github/extract.go b/plugins/github/pkg/github/extract.go index 984f0213..6054d994 100644 --- a/plugins/github/pkg/github/extract.go +++ b/plugins/github/pkg/github/extract.go @@ -35,6 +35,7 @@ func (p *Plugin) Fields() []sdk.FieldEntry { {Type: "string", Name: "github.repo", Display: "Repository", Desc: "(deprecated) URL of the git repository where the event occurred. Github Webhook payloads contain the repository property when the event occurs from activity in a repository."}, {Type: "string", Name: "github.repo.url", Display: "Repository URL", Desc: "URL of the git repository where the event occurred. Github Webhook payloads contain the repository property when the event occurs from activity in a repository."}, {Type: "string", Name: "github.repo.name", Display: "Repository Name", Desc: "Name of the git repository where the event occurred. Github Webhook payloads contain the repository property when the event occurs from activity in a repository."}, + {Type: "string", Name: "github.repo.description", Display: "Repository Description", Desc: "Description of the GitHub repository."}, {Type: "string", Name: "github.org", Display: "Organization", Desc: "Name of the organization the git repository belongs to."}, {Type: "string", Name: "github.owner", Display: "Owner", Desc: "Name of the repository's owner."}, {Type: "string", Name: "github.repo.public", Display: "Public", Desc: "'true' if the repository affected by the action is public. 'false' otherwise."}, @@ -145,6 +146,8 @@ func getfieldStr(jdata *fastjson.Value, field string) (bool, string) { case "github.repo.name": res = string(jdata.Get("repository", "html_url").GetStringBytes()) res = strings.TrimPrefix(res, "https://github.com/") + case "github.repo.description": + res = string(jdata.Get("repository", "description").GetStringBytes()) case "github.org": res = string(jdata.Get("organization", "login").GetStringBytes()) case "github.owner":