]> apps.delaporte.us Git - dotfiles.git/blobdiff - psmodules/edgithub.psm1
Shorter
[dotfiles.git] / psmodules / edgithub.psm1
index 76b7feb5e628b98de98274ab44bbf14d8a5d0744..2a844eb000fffb4f3a491b7df4a371daf816e87a 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
 
@@ -73,8 +95,13 @@ function Show-GHMine() {
 }
 
 <#
 }
 
 <#
+.SYNOPSIS
+
+Get GitHub issues that need sized.
 
 
-Target GitHub search:
+.DESCRIPTION
+
+Runs this GitHub search:
 is:open is:issue -label:M -label:L -label:S -label:XL -label:XS 
 
 #>
 is:open is:issue -label:M -label:L -label:S -label:XL -label:XS 
 
 #>
@@ -96,6 +123,23 @@ function Get-GHUnsized() {
   return $issues
 }
 
   return $issues
 }
 
+function Get-GHNoMilestone() {
+  $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login')
+  $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' }
+  $issues = @()
+  $repos | ForEach-Object { 
+    $issues += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
+  }
+
+  # Get open issues with empty milestone
+  $issues = $issues | Where-Object { $null -eq $_.milestone }
+  return $issues
+}
+function Show-GHNoMilestone(){
+  Get-GHNoMilestone| Show-GHIssuesAsMarkdown
+}
+
+
 function Show-GHUnsized() {
   Get-GHUnsized | ForEach-Object {
     # Markdown output
 function Show-GHUnsized() {
   Get-GHUnsized | ForEach-Object {
     # Markdown output
@@ -103,9 +147,40 @@ function Show-GHUnsized() {
   }
 }
 
   }
 }
 
+function Show-GHByAssignee() {
+  $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login')
+  $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' }
+  $issues = @()
+  $repos | ForEach-Object { 
+    $issues += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
+  }
+
+  # TODO: Group output by assignee.
+
+  return $issues
+}
+
+
+
+function Show-GHToDiscuss() {
+  Get-GHToDiscuss | Show-GHIssuesAsMarkdown
+}
+
+
+function Show-GHIssuesAsMarkdown() {
+  process
+       {
+    # Markdown output
+    " + [" + $_.Title + " (" + $_.Number + ")](" + $_.html_url + ")" 
+  }
+}
+
+
 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
+Export-ModuleMember -Function Show-GHNoMilestone
\ No newline at end of file