4 Fetch closed GitHub issues that were updated in the last 14 days.
8 Thism modules requires the following in your PowerShell profile:
9 $env:GITHUB_USERNAME = 'github_username'
10 $env:GITHUB_ORG = 'github_organization_name'
11 $env:GITHUB_REPOS = @('repository1', 'repository2', 'repository3')
14 function Get-GHClosed {
18 $repos = $env:GITHUB_REPOS.split(" ")
19 $issueSearchParams = @{ State = 'closed'; OwnerName = $env:GITHUB_ORG }
21 $repos | ForEach-Object {
22 $closed += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
25 # Limit to past two weeks
26 $issues = $closed | Where-Object { $_.updated_at -gt (Get-Date).AddDays($days) }
34 Fetch GitHub issues that are tagged to discuss this morning.
37 function Get-GHToDiscuss {
41 $repos = $env:GITHUB_REPOS.split(" ")
42 $issueSearchParams = @{ State = 'open'; OwnerName = $env:GITHUB_ORG }
44 $repos | ForEach-Object {
45 $closed += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
47 $issues = $issues | Where-Object { $_.labels -Contains 'DiscussAtStandUp' }
56 Show closed GitHub issues that were updated in the last 14 days.
59 function Show-GHClosed() {
63 Get-GHClosed -days $days | ForEach-Object {
65 " + [" + $_.Title + " (" + $_.Number + ")](" + $_.html_url + ")"
67 # Format-Table -Property Number, Title, Url
74 Fetch GitHub issues I am working on.
77 function Get-GHMine() {
78 $repos = $env:GITHUB_REPOS.split(" ")
79 $issueSearchParams = @{ Assignee = $env:GITHUB_USERNAME;
80 State = 'open'; OwnerName = $env:GITHUB_ORG }
82 $repos | ForEach-Object {
83 $issues += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
86 # Ignore issues that have been updated in the last day.
87 $issues = $issues | Where-Object { $_.updated_at -lt (Get-Date).AddDays(-1) }
95 Show GitHub issues I am working on.
98 function Show-GHMine() {
99 Get-GHMine | ForEach-Object {
101 " + [" + $_.Title + " (" + $_.Number + ")](" + $_.html_url + ")"
108 Get GitHub issues that need sized.
112 Runs this GitHub search:
113 is:open is:issue -label:M -label:L -label:S -label:XL -label:XS
116 function Get-GHUnsized() {
117 $repos = $env:GITHUB_REPOS.split(" ")
118 $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' }
120 $repos | ForEach-Object {
121 $issues += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
124 # Ignore issues that have been updated in the last day.
125 $issues = $issues | Where-Object { -Not $_.labels -Contains 'XS' }
126 $issues = $issues | Where-Object { -Not $_.labels -Contains 'S' }
127 $issues = $issues | Where-Object { -Not $_.labels -Contains 'M' }
128 $issues = $issues | Where-Object { -Not $_.labels -Contains 'L' }
129 # Leave XL issues, as they need split.
134 function Get-GHNoMilestone() {
138 $repos = $env:GITHUB_REPOS.split(" ")
140 $repos = @($repository)
142 $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' }
144 $repos | ForEach-Object {
145 $issues += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
148 # Get open issues with empty milestone
149 $issues = $issues | Where-Object { $null -eq $_.milestone }
152 function Show-GHNoMilestone(){
156 Get-GHNoMilestone -Repository $repository | Show-GHIssuesAsMarkdown
159 function Show-GHUnsized() {
160 Get-GHUnsized | ForEach-Object {
162 " + [" + $_.Title + " (" + $_.Number + ")](" + $_.html_url + ")" + $_.labels
166 function Show-GHByAssignee() {
167 $repos = $env:GITHUB_REPOS.split(" ")
168 $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' }
170 $repos | ForEach-Object {
171 $issues += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
174 # TODO: Group output by assignee.
181 function Show-GHToDiscuss() {
182 Get-GHToDiscuss | Show-GHIssuesAsMarkdown
186 function Show-GHIssuesAsMarkdown() {
190 " + [" + $_.Title + " (" + $_.Number + ")](" + $_.html_url + ")"
195 Export-ModuleMember -Function Get-GHClosed
196 Export-ModuleMember -Function Show-GHClosed
197 Export-ModuleMember -Function Get-GHMine
198 Export-ModuleMember -Function Show-GHMine
199 Export-ModuleMember -Function Get-GHUnsized
200 Export-ModuleMember -Function Show-GHUnsized
201 Export-ModuleMember -Function Show-GHToDiscuss
202 Export-ModuleMember -Function Get-GHNoMilestone
203 Export-ModuleMember -Function Show-GHNoMilestone