]> apps.delaporte.us Git - dotfiles.git/commitdiff
Show-GHToDiscuss drafted
authorEdward Delaporte <delaport@illinois.edu>
Wed, 1 Sep 2021 15:32:12 +0000 (10:32 -0500)
committerEdward Delaporte <delaport@illinois.edu>
Wed, 1 Sep 2021 15:32:12 +0000 (10:32 -0500)
psmodules/edgithub.psm1

index 76b7feb5e628b98de98274ab44bbf14d8a5d0744..949974ed312be1fcd767b58abaa5edf35b62dfb3 100644 (file)
@@ -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
 
 <#
 .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 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