From 3c06f229e9d23d8ed350039ac06f73bb83857c4c Mon Sep 17 00:00:00 2001 From: rulasg Date: Wed, 16 Jul 2025 11:57:26 +0200 Subject: [PATCH 1/3] fix: Remove unnecessary null check for result in Test-RepoAccess function --- public/getRepoAccess.ps1 | 2 -- 1 file changed, 2 deletions(-) diff --git a/public/getRepoAccess.ps1 b/public/getRepoAccess.ps1 index 2a52626..50d9288 100644 --- a/public/getRepoAccess.ps1 +++ b/public/getRepoAccess.ps1 @@ -118,8 +118,6 @@ function Test-RepoAccess{ $result = Invoke-MyCommandJson -Command TestUserAccess -Parameters $param 2> $null - $ret = $null -eq $result - if($null -eq $result){ "User $User has access to $Owner/$Repo" | Write-Verbose $ret = $true From 6d439cfe1e369218698b5f84c8fff7a97e78c1de Mon Sep 17 00:00:00 2001 From: rulasg Date: Wed, 16 Jul 2025 11:57:43 +0200 Subject: [PATCH 2/3] fix: Update getToken alias to use 'gh auth token' command --- public/setRepoProperties.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/setRepoProperties.ps1 b/public/setRepoProperties.ps1 index 856f251..08a77a8 100644 --- a/public/setRepoProperties.ps1 +++ b/public/setRepoProperties.ps1 @@ -9,7 +9,7 @@ curl -L -s -H "Authorization: Bearer {token}" -X PATCH https://api.github.com/re '@ Set-MyInvokeCommandAlias -Alias SetRepoProperty -Command $cmd -Set-MyInvokeCommandAlias -Alias getToken -Command "Get-UserToken" +Set-MyInvokeCommandAlias -Alias getToken -Command "gh auth token" <# .SYNOPSIS From 2d31a5ee2fd6c3221659c0cab0cae60a6b1a7871 Mon Sep 17 00:00:00 2001 From: rulasg Date: Wed, 16 Jul 2025 12:01:25 +0200 Subject: [PATCH 3/3] fix: test mock --- Test/public/RepoIssueTimeTracking.test.ps1 | 4 ++-- Test/public/addRepoIssueComment.test.ps1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Test/public/RepoIssueTimeTracking.test.ps1 b/Test/public/RepoIssueTimeTracking.test.ps1 index b5cfcdc..5aa8df5 100644 --- a/Test/public/RepoIssueTimeTracking.test.ps1 +++ b/Test/public/RepoIssueTimeTracking.test.ps1 @@ -143,7 +143,7 @@ function Test_GetRepoIssueTimeTracking_Pipe { Reset-InvokeCommandMock - $owner = "rulasgorgkk" ; $repo = "repo1" ; $attributes = "title,comments,url" ; $attributes2 = "number,title,url" + $owner = "rulasgorgkk" ; $repo = "repo1" ; $attributes = "title,comments,url" ; $attributes2 = "number,title,state,url" MockCall -Command "gh issue list -R $owner/$repo --json $attributes2" -filename getIssueList.json @@ -186,7 +186,7 @@ function Test_GetRepoIssueTimeTrackingRecords_Pipe { Reset-InvokeCommandMock - $owner = "rulasgorgkk" ; $repo = "repo1" ; $attributes = "title,comments,url" ; $attributes2 = "number,title,url" + $owner = "rulasgorgkk" ; $repo = "repo1" ; $attributes = "title,comments,url" ; $attributes2 = "number,title,state,url" MockCall -Command "gh issue list -R $owner/$repo --json $attributes2" -filename getIssueList.json diff --git a/Test/public/addRepoIssueComment.test.ps1 b/Test/public/addRepoIssueComment.test.ps1 index 0243e2d..35651e3 100644 --- a/Test/public/addRepoIssueComment.test.ps1 +++ b/Test/public/addRepoIssueComment.test.ps1 @@ -53,7 +53,7 @@ function Test_GetRepoIssues_Success{ Reset-InvokeCommandMock - $owner = 'solidifycustomers' ; $repo = 'bit21' ; $attributes="number,title,url" + $owner = 'solidifycustomers' ; $repo = 'bit21' ; $attributes="number,title,state,url" MockCall -Command "gh issue list -R $owner/$repo --json $attributes" -filename getIssueList.json