-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dbt): add comment_events for issues and PRs (#2147)
* feat(dbt): add release_published github event type * feat(dbt): add comment_events for issues and PRs * fix(dbt): missing parenth
- Loading branch information
Showing
5 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
warehouse/dbt/models/staging/github/stg_github__comments.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
with pull_request_comment_events as ( | ||
select | ||
ghe.id as id, | ||
ghe.created_at as created_at, | ||
ghe.repo.id as repository_id, | ||
ghe.repo.name as repository_name, | ||
ghe.actor.id as actor_id, | ||
ghe.actor.login as actor_login, | ||
'PULL_REQUEST_REVIEW_COMMENT' as `type`, | ||
JSON_VALUE(ghe.payload, '$.pull_request.number') as `number` | ||
from {{ ref('stg_github__events') }} as ghe | ||
where ghe.type = 'PullRequestReviewCommentEvent' | ||
), | ||
|
||
issue_comment_events as ( | ||
select | ||
ghe.id as id, | ||
ghe.created_at as created_at, | ||
ghe.repo.id as repository_id, | ||
ghe.repo.name as repository_name, | ||
ghe.actor.id as actor_id, | ||
ghe.actor.login as actor_login, | ||
'ISSUE_COMMENT' as `type`, | ||
JSON_VALUE(ghe.payload, '$.issue.number') as `number` | ||
from {{ ref('stg_github__events') }} as ghe | ||
where ghe.type = 'IssueCommentEvent' | ||
) | ||
|
||
select * from pull_request_comment_events | ||
union all | ||
select * from issue_comment_events |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters