]> us-delaporte.pagekite.me Git - dotfiles.git/commitdiff
List my GitHub issues.
authorEdward Delaporte <delaport@illinois.edu>
Wed, 7 Jul 2021 14:07:43 +0000 (09:07 -0500)
committerEdward Delaporte <delaport@illinois.edu>
Wed, 7 Jul 2021 14:07:43 +0000 (09:07 -0500)
Microsoft.PowerShell_profile.ps1
psmodules/dash.psm1
psmodules/edgithub.psm1

index 00ba3b96105d20bcb2c38c31f5284ea07caf3395..f70c705774b77adf471cbf91753cb0e9e9669ed6 100644 (file)
@@ -100,23 +100,14 @@ function Get-GitStatus() {
        git status -b --short
 }
 
        git status -b --short
 }
 
-function Get-DashBoard() {
-       Measure-JournalTodos
-       chart
-       # todo
-       # Get-JournalAgenda
-       Write-Host "Todo items for today:"
-       Get-JournalTodayTodos
-       Write-Host "Use command 'todo' to list more tasks."
-       Write-Host "Use command 'agenda' to list the plan for today."
-}
-
 function Get-JournalAgenda() {
        Get-Content $(Get-JournalFile -date $(Get-Date))
 }
 
 function Get-JournalAgenda() {
        Get-Content $(Get-JournalFile -date $(Get-Date))
 }
 
-
+# Nice for git
 New-Alias ol           Get-GitLog
 New-Alias st           Get-GitStatus
 New-Alias ol           Get-GitLog
 New-Alias st           Get-GitStatus
-New-Alias dash  Get-Dashboard
+
+# Dashboard
+New-Alias dash   Get-MyDashboard # See dash.psm1
 New-Alias agenda Get-JournalAgenda
 New-Alias agenda Get-JournalAgenda
index 560f7293e4ac2ebeaa1041a13131ef7fdd7dc17b..4b74daac422d824c42e93ca24edb7600b922367d 100644 (file)
@@ -1,19 +1,16 @@
 
 
-function Get-MyDashboard() {
-  $MyDashboard = New-UDDashboard -Title "Hello, World" -Content {
-    New-UDCard -Title "Hello, Universal Dashboard" -Content {
-      New-UDParagraph -Text 'I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.'
-    } -Links @(
-      New-UDLink -Text 'This is a link' -Url '#!'
-      New-UDLink -Text 'This is a link' -Url '#!'
-      ) -Size 'small'
-    }
-  return $MyDashboard
+function Get-MyDashBoard() {
+       Measure-JournalTodos
+       chart
+       # todo
+       # Get-JournalAgenda
+       Write-Host "Todo items for today:"
+       Get-JournalTodayTodos
+  Write-Host "GitHub Issues Assigned"
+  Show-GHMine
+       Write-Host "Use command 'todo' to list more tasks."
+       Write-Host "Use command 'agenda' to list the plan for today."
 }
 
 }
 
-function Inovke-MyDashboard() {
-  Start-UDDashboard -Port 1000 -Dashboard Get-MyDashboard
-  Write-Host "http://localhost:1000"
-}
 
 
-Export-ModuleMember -Function Invoke-MyDashboard
\ No newline at end of file
+Export-ModuleMember -Function Get-MyDashboard
\ No newline at end of file
index 0f26e2433919ada46c4dcc1006d16162d3809fbc..a1f7c7a7ff87d8aef10403ebffa2bf639e91aa8b 100644 (file)
@@ -39,5 +39,42 @@ function Show-GHClosed() {
 
 }
 
 
 }
 
+<#
+.SYNPOSIS
+
+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 = @()
+  $repos | ForEach-Object { 
+    $issues += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
+  }
+
+  return $issues
+}
+
+<#
+.SYNOPSIS
+
+Show GitHub issues I am working on.
+
+#>
+function Show-GHMine() {
+  param(
+  )
+  Get-GHMine | ForEach-Object {
+    # Markdown output
+    " + [" + $_.Title + " (" + $_.Number + ")](" + $_.html_url + ")"
+  }
+}
+
+
 Export-ModuleMember -Function Get-GHClosed
 Export-ModuleMember -Function Get-GHClosed
-Export-ModuleMember -Function Show-GHClosed
\ No newline at end of file
+Export-ModuleMember -Function Show-GHClosed
+Export-ModuleMember -Function Show-GHMine
\ No newline at end of file