Skip to content

Commit 8afae86

Browse files
🩹 [Patch]: Update test to connect a GitHub App using Connect-GitHubApp (#60)
## Description This pull request updates the `.github/workflows/TestWorkflow.yml` file to improve the organization and output formatting of GitHub-related logs in the workflow scripts. The most important changes include switching from `Format-Table` to `Format-List` for better readability, restructuring log groups for clarity, and replacing specific installation token-based connections with a streamlined `Connect-GitHubApp` command. ### Improvements to output formatting: * Changed the output formatting from `Format-Table` to `Format-List` for `Get-GitHubApp` and `Get-GitHubConfig` commands to enhance readability. [[1]](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cL491-R507) [[2]](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cL522-R542) ### Workflow restructuring: * Replaced the token-based connection logic (`New-GitHubAppInstallationAccessToken` and `Connect-GitHub`) with a simplified `Connect-GitHubApp` command to connect to all installations of the app. [[1]](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cL491-R507) [[2]](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cL522-R542) * Added new log groups for `Contexts` (`Get-GitHubContext -ListAvailable`) and `GitHubConfig` (`Get-GitHubConfig`) to improve clarity and organization of workflow logs. [[1]](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cL491-R507) [[2]](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cL522-R542) ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 19dcf65 commit 8afae86

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

.github/workflows/TestWorkflow.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -488,19 +488,23 @@ jobs:
488488
Prerelease: ${{ inputs.Prerelease }}
489489
Script: |
490490
LogGroup 'Get-GitHubApp' {
491-
Get-GitHubApp | Format-Table -AutoSize | Out-String
491+
Get-GitHubApp | Format-List | Out-String
492492
}
493493
494494
LogGroup 'Get-GitHubAppInstallation' {
495495
Get-GitHubAppInstallation | Format-Table -AutoSize | Out-String
496496
}
497497
498-
LogGroup 'Do something as an installation' {
499-
Get-GithubAppInstallation | New-GitHubAppInstallationAccessToken | ForEach-Object {
500-
Connect-GitHub -Token $_.token -Silent
501-
Get-GitHubContext | Format-Table -AutoSize | Out-String
502-
Get-GitHubGitConfig | Format-Table -AutoSize | Out-String
503-
}
498+
LogGroup 'Connect to all installations of the app' {
499+
Connect-GitHubApp
500+
}
501+
502+
LogGroup 'Contexts' {
503+
Get-GitHubContext -ListAvailable | Format-Table -AutoSize | Out-String
504+
}
505+
506+
LogGroup 'GitHubConfig' {
507+
Get-GitHubConfig | Format-List | Out-String
504508
}
505509
506510
ActionTestWithGitHubAppOrg:
@@ -519,19 +523,23 @@ jobs:
519523
Prerelease: ${{ inputs.Prerelease }}
520524
Script: |
521525
LogGroup 'Get-GitHubApp' {
522-
Get-GitHubApp | Format-Table -AutoSize | Out-String
526+
Get-GitHubApp | Format-List | Out-String
523527
}
524528
525529
LogGroup 'Get-GitHubAppInstallation' {
526530
Get-GitHubAppInstallation | Format-Table -AutoSize | Out-String
527531
}
528532
529-
LogGroup 'Do something as an installation' {
530-
Get-GithubAppInstallation | New-GitHubAppInstallationAccessToken | ForEach-Object {
531-
Connect-GitHub -Token $_.token -Silent
532-
Get-GitHubContext | Format-Table -AutoSize | Out-String
533-
Get-GitHubGitConfig | Format-Table -AutoSize | Out-String
534-
}
533+
LogGroup 'Connect to all installations of the app' {
534+
Connect-GitHubApp
535+
}
536+
537+
LogGroup 'Contexts' {
538+
Get-GitHubContext -ListAvailable | Format-Table -AutoSize | Out-String
539+
}
540+
541+
LogGroup 'GitHubConfig' {
542+
Get-GitHubConfig | Format-List | Out-String
535543
}
536544
537545
ActionTestPreserveCredentialsFalse:

0 commit comments

Comments
 (0)