]> us-delaporte.pagekite.me Git - dotfiles.git/blobdiff - psmodules/edgithub.psm1
Utility to show unsized GitHub issues.
[dotfiles.git] / psmodules / edgithub.psm1
index a1f7c7a7ff87d8aef10403ebffa2bf639e91aa8b..76b7feb5e628b98de98274ab44bbf14d8a5d0744 100644 (file)
@@ -46,9 +46,6 @@ Fetch GitHub issues I am working on.
 
 #>
 function Get-GHMine() {
-  param(
-    [int]$days = -14
-  )
   $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login')
   $issueSearchParams = @{ Assignee = 'edthedev'; State = 'open'; OwnerName = 'techservicesillinois' }
   $issues = @()
@@ -56,6 +53,9 @@ function Get-GHMine() {
     $issues += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
   }
 
+  # Ignore issues that have been updated in the last day.
+  $issues = $issues | Where-Object { $_.updated_at -lt (Get-Date).AddDays(-1) }
+
   return $issues
 }
 
@@ -66,15 +66,46 @@ Show GitHub issues I am working on.
 
 #>
 function Show-GHMine() {
-  param(
-  )
   Get-GHMine | ForEach-Object {
     # Markdown output
     " + [" + $_.Title + " (" + $_.Number + ")](" + $_.html_url + ")"
   }
 }
 
+<#
+
+Target GitHub search:
+is:open is:issue -label:M -label:L -label:S -label:XL -label:XS 
+
+#>
+function Get-GHUnsized() {
+  $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login')
+  $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' }
+  $issues = @()
+  $repos | ForEach-Object { 
+    $issues += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
+  }
+
+  # Ignore issues that have been updated in the last day.
+  $issues = $issues | Where-Object { -Not $_.labels -Contains 'XS' }
+  $issues = $issues | Where-Object { -Not $_.labels -Contains 'S' }
+  $issues = $issues | Where-Object { -Not $_.labels -Contains 'M' }
+  $issues = $issues | Where-Object { -Not $_.labels -Contains 'L' }
+  # Leave XL issues, as they need split.
+
+  return $issues
+}
+
+function Show-GHUnsized() {
+  Get-GHUnsized | ForEach-Object {
+    # Markdown output
+    " + [" + $_.Title + " (" + $_.Number + ")](" + $_.html_url + ")" + $_.labels
+  }
+}
 
 Export-ModuleMember -Function Get-GHClosed
 Export-ModuleMember -Function Show-GHClosed
-Export-ModuleMember -Function Show-GHMine
\ No newline at end of file
+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