-
Notifications
You must be signed in to change notification settings - Fork 0
/
baseline.sh
117 lines (112 loc) · 2.82 KB
/
baseline.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/usr/bin/env bash
GH_ORG="jpienaar"
GH_NAME="github-issues-dot"
# Get all milestones
gh api graphql --paginate \
-F owner=$GH_ORG -F name=$GH_NAME -f query='
query ListMilestones($name: String!, $owner: String!, $endCursor: String) {
repository(owner: $owner, name: $name) {
milestones(first: 100, after: $endCursor) {
nodes {
title
number
description
dueOn
url
state
closed
closedAt
updatedAt
}
}
}
}
' > milestones.json
# Get ~all issues
gh api graphql --paginate -F owner=$GH_ORG -F name=$GH_NAME -f query='
query ListIssues($name: String!, $owner: String!, $endCursor: String) {
repository(owner: $owner, name: $name) {
issues(first: 100, after: $endCursor) {
totalCount
pageInfo {
startCursor
hasNextPage
endCursor
}
nodes {
number
title
state
labels(first: 100) {
totalCount
pageInfo {
startCursor
hasNextPage
endCursor
}
... on LabelConnection {
edges {
node {
id
}
}
}
}
milestone {
number
}
trackedIssues(first: 100) {
totalCount
pageInfo {
startCursor
hasNextPage
endCursor
}
... on IssueConnection {
nodes {
number
}
}
}
}
}
}
}' > issues.json
# Get cross references
gh api graphql --paginate \
-F owner=$GH_ORG -F name=$GH_NAME -f query='
query($owner: String!, $name: String!, $endCursor:String) {
repository(owner: $owner, name: $name) {
issues(first: 100, after: $endCursor) {
totalCount
pageInfo {
startCursor
hasNextPage
endCursor
}
edges {
node {
number
timelineItems(first: 200, itemTypes: CROSS_REFERENCED_EVENT) {
totalCount
pageInfo {
startCursor
hasNextPage
endCursor
}
nodes {
... on CrossReferencedEvent {
isCrossRepository
source {
... on Issue {
number
}
}
}
}
}
}
}
}
}
}' > cross_referenced.json