]> us-delaporte.pagekite.me Git - dotfiles.git/commitdiff
Repository flag for NoMilestone
authorEdward Delaporte <delaport@illinois.edu>
Thu, 11 Nov 2021 19:35:37 +0000 (13:35 -0600)
committerEdward Delaporte <delaport@illinois.edu>
Thu, 11 Nov 2021 19:35:37 +0000 (13:35 -0600)
Microsoft.PowerShell_profile.ps1
psmodules/dash.psm1
psmodules/edgithub.psm1

index a57c48a7ba0750cf6e21ab4790c9a78600d0c2cb..bc14d5d8c10fd52e0eaa2018386d28f56e34d2c2 100644 (file)
@@ -100,6 +100,11 @@ function Get-GitStatus() {
        git status -b --short
 }
 
        git status -b --short
 }
 
+# Tell my scripts which GitHub repositories to look in.
+$env:GITHUB_USERNAME = 'edthedev'
+$env:GITHUB_ORG = 'techservicesillinois'
+$env:GITHUB_REPOS = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login')
+
 # Nice for git
 New-Alias ol           Get-GitLog
 New-Alias st           Get-GitStatus
 # Nice for git
 New-Alias ol           Get-GitLog
 New-Alias st           Get-GitStatus
index 3bfb4c6b400adb9de9a34d335ec7b5356c61bd31..99c5a3c11283a629f9fbf135412c2d62ded1302c 100644 (file)
@@ -9,7 +9,7 @@ function Get-MyDashBoard() {
        Write-Host "## GitHub Issues Assigned"
        Show-GHMine
        Write-Host "## GitHub Issues with no milestone. (Show-GHNoMilestone)"
        Write-Host "## GitHub Issues Assigned"
        Show-GHMine
        Write-Host "## GitHub Issues with no milestone. (Show-GHNoMilestone)"
-       Get-GHNoMilestone | Measure-Object -Property updated_at -Min -Max
+       Get-GHNoMilestone -repository SecOps-Tools | Measure-Object -Property updated_at -Min -Max
        Write-Host "Use command 'todo' to list more tasks."
        Write-Host "Use command 'chart' to show todo item progress."
        Write-Host "Use command 'agenda' to list the plan for today."
        Write-Host "Use command 'todo' to list more tasks."
        Write-Host "Use command 'chart' to show todo item progress."
        Write-Host "Use command 'agenda' to list the plan for today."
index 8822bd3791779cda6967d9da89294482bc94c10f..f24fcfa87619227226a0dcf2fde8ef372660ee80 100644 (file)
@@ -3,13 +3,20 @@
 
 Fetch closed GitHub issues that were updated in the last 14 days.
 
 
 Fetch closed GitHub issues that were updated in the last 14 days.
 
+.NOTES
+
+Thism modules requires the following in your PowerShell profile:
+$env:GITHUB_USERNAME = 'github_username'
+$env:GITHUB_ORG = 'github_organization_name'
+$env:GITHUB_REPOS = @('repository1', 'repository2', 'repository3')
+
 #>
 function Get-GHClosed {
   param(
     [int]$days = -14
   )
 #>
 function Get-GHClosed {
   param(
     [int]$days = -14
   )
-  $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login')
-  $issueSearchParams = @{ State = 'closed'; OwnerName = 'techservicesillinois' }
+  $repos = $env:GITHUB_REPOS.split(" ")
+  $issueSearchParams = @{ State = 'closed'; OwnerName = $env:GITHUB_ORG }
   $closed = @()
   $repos | ForEach-Object { 
     $closed += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
   $closed = @()
   $repos | ForEach-Object { 
     $closed += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
@@ -31,8 +38,8 @@ function Get-GHToDiscuss {
   param(
     [int]$days = -14
   )
   param(
     [int]$days = -14
   )
-  $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login')
-  $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' }
+  $repos = $env:GITHUB_REPOS.split(" ")
+  $issueSearchParams = @{ State = 'open'; OwnerName = $env:GITHUB_ORG }
   $closed = @()
   $repos | ForEach-Object { 
     $closed += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
   $closed = @()
   $repos | ForEach-Object { 
     $closed += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
@@ -68,8 +75,9 @@ Fetch GitHub issues I am working on.
 
 #>
 function Get-GHMine() {
 
 #>
 function Get-GHMine() {
-  $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login')
-  $issueSearchParams = @{ Assignee = 'edthedev'; State = 'open'; OwnerName = 'techservicesillinois' }
+  $repos = $env:GITHUB_REPOS.split(" ")
+  $issueSearchParams = @{ Assignee = $env:GITHUB_USERNAME;
+    State = 'open'; OwnerName = $env:GITHUB_ORG }
   $issues = @()
   $repos | ForEach-Object { 
     $issues += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
   $issues = @()
   $repos | ForEach-Object { 
     $issues += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
@@ -106,7 +114,7 @@ is:open is:issue -label:M -label:L -label:S -label:XL -label:XS
 
 #>
 function Get-GHUnsized() {
 
 #>
 function Get-GHUnsized() {
-  $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login')
+  $repos = $env:GITHUB_REPOS.split(" ")
   $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' }
   $issues = @()
   $repos | ForEach-Object { 
   $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' }
   $issues = @()
   $repos | ForEach-Object { 
@@ -124,7 +132,13 @@ function Get-GHUnsized() {
 }
 
 function Get-GHNoMilestone() {
 }
 
 function Get-GHNoMilestone() {
-  $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login')
+  param(
+    [string]$repository
+  )
+  $repos = $env:GITHUB_REPOS.split(" ")
+  if($repository){
+    $repos = @($repository)
+  }
   $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' }
   $issues = @()
   $repos | ForEach-Object { 
   $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' }
   $issues = @()
   $repos | ForEach-Object { 
@@ -136,7 +150,10 @@ function Get-GHNoMilestone() {
   return $issues
 }
 function Show-GHNoMilestone(){
   return $issues
 }
 function Show-GHNoMilestone(){
-  Get-GHNoMilestone| Show-GHIssuesAsMarkdown
+  param(
+    [string]$repository
+  )
+  Get-GHNoMilestone -Repository $repository | Show-GHIssuesAsMarkdown
 }
 
 function Show-GHUnsized() {
 }
 
 function Show-GHUnsized() {
@@ -147,7 +164,7 @@ function Show-GHUnsized() {
 }
 
 function Show-GHByAssignee() {
 }
 
 function Show-GHByAssignee() {
-  $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login')
+  $repos = $env:GITHUB_REPOS.split(" ")
   $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' }
   $issues = @()
   $repos | ForEach-Object { 
   $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' }
   $issues = @()
   $repos | ForEach-Object {