]> us-delaporte.pagekite.me Git - dotfiles.git/blob - psmodules/github.psm1
Merge PATH
[dotfiles.git] / psmodules / github.psm1
1 <#
2 .SYNPOSIS
3
4 Fetch closed GitHub issues that were updated in the last 14 days.
5
6 #>
7 function Get-GHClosed {
8 param(
9 [int]$days = -14
10 )
11 $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login')
12 $issueSearchParams = @{ State = 'closed'; OwnerName = 'techservicesillinois' }
13 $closed = @()
14 $repos | ForEach-Object {
15 $closed += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
16 }
17
18 # Limit to past two weeks
19 $issues = $closed | Where-Object { $_.updated_at -gt (Get-Date).AddDays($days) }
20 return $issues
21 }
22
23
24 <#
25 .SYNOPSIS
26
27 Show closed GitHub issues that were updated in the last 14 days.
28
29 #>
30 function Show-GHClosed() {
31 param(
32 [int]$days = -14
33 )
34 Get-GHClosed -days $days | ForEach-Object {
35 # Markdown output
36 " + [" + $_.Title + " (" + $_.Number + ")](" + $_.html_url + ")"
37 }
38 # Format-Table -Property Number, Title, Url
39
40 }
41
42 Export-ModuleMember -Function Get-GHClosed
43 Export-ModuleMember -Function Show-GHClosed