From 3000302e7e283507dd67e77f6931d602e186e866 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Wed, 1 Sep 2021 10:32:12 -0500 Subject: [PATCH] Show-GHToDiscuss drafted --- psmodules/edgithub.psm1 | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/psmodules/edgithub.psm1 b/psmodules/edgithub.psm1 index 76b7feb..949974e 100644 --- a/psmodules/edgithub.psm1 +++ b/psmodules/edgithub.psm1 @@ -21,6 +21,28 @@ function Get-GHClosed { } +<# +.SYNPOSIS + +Fetch GitHub issues that are tagged to discuss this morning. + +#> +function Get-GHToDiscuss { + param( + [int]$days = -14 + ) + $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login') + $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' } + $closed = @() + $repos | ForEach-Object { + $closed += Get-GitHubIssue -RepositoryName $_ @issueSearchParams + } + $issues = $issues | Where-Object { $_.labels -Contains 'DiscussAtStandUp' } + + return $issues +} + + <# .SYNOPSIS @@ -103,9 +125,24 @@ function Show-GHUnsized() { } } +function Show-GHToDiscuss() { + Get-GHToDiscuss | Show-GHIssuesAsMarkdown +} + + +function Show-GHIssuesAsMarkdown() { + process + { + # Markdown output + " + [" + $_.Title + " (" + $_.Number + ")](" + $_.html_url + ")" + $_.labels + } +} + + Export-ModuleMember -Function Get-GHClosed Export-ModuleMember -Function Show-GHClosed Export-ModuleMember -Function Get-GHMine Export-ModuleMember -Function Show-GHMine Export-ModuleMember -Function Get-GHUnsized -Export-ModuleMember -Function Show-GHUnsized \ No newline at end of file +Export-ModuleMember -Function Show-GHUnsized +Export-ModuleMember -Function Show-GHToDiscuss \ No newline at end of file -- 2.47.3