Skip to content

Instantly share code, notes, and snippets.

@judell
Last active January 5, 2022 22:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save judell/ce6a4512db0e43c5244137484422a1de to your computer and use it in GitHub Desktop.
Save judell/ce6a4512db0e43c5244137484422a1de to your computer and use it in GitHub Desktop.
summarize github issues where i am author/assignee/mention or a commenter
create materialized view my_github_activity as (
with my_created_issues as (
select
*
from
github_search_issue
where
query = 'is:issue author:judell'
and html_url ~ 'turbot'
),
my_assigned_issues as (
select
*
from
github_search_issue
where
query = 'is:issue assignee:judell'
and html_url ~ 'turbot'
),
my_mentioned_issues as (
select
*
from
github_search_issue
where
query = 'is:issue mentions:judell'
and html_url ~ 'turbot'
),
my_comments as (
select
*
from
github_search_issue
where
query = 'is:issue in:comments judell'
and html_url ~ 'turbot'
),
combined as (
select * from my_created_issues
union
select * from my_assigned_issues
union
select * from my_mentioned_issues
union
select * from my_comments
)
select distinct
html_url,
state,
title,
updated_at,
created_at,
comments
from
combined
order by
updated_at desc
) with data;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment