

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
123456789# Log Grouping Guidelines for GitHub Actions1011## Purpose1213Guidelines for using `Write-LogGroupStart` and `Write-LogGroupEnd` to create collapsible log sections in GitHub Actions CI/CD runs.1415## Key Principles1617### 1. Groups Cannot Be Nested1819GitHub Actions does not support nested groups. Only use one level of grouping.2021**❌ Don't:**22```powershell23Write-LogGroupStart -Title "Outer Group"24Write-LogGroupStart -Title "Inner Group"25# ... operations ...26Write-LogGroupEnd -Title "Inner Group"27Write-LogGroupEnd -Title "Outer Group"28```2930**✅ Do:**31```powershell32Write-LogGroupStart -Title "Operation A"33# ... operations ...34Write-LogGroupEnd -Title "Operation A"3536Write-LogGroupStart -Title "Operation B"37# ... operations ...38Write-LogGroupEnd -Title "Operation B"39```4041### 2. Groups Should Be Substantial4243Only create groups for operations that generate substantial output (5+ lines). Small groups add clutter without benefit.4445**❌ Don't:**46```powershell47Write-LogGroupStart -Title "Generate Resource Files"48Write-Log -message "Run ResGen"49Start-ResGen50Write-LogGroupEnd -Title "Generate Resource Files"51```5253**✅ Do:**54```powershell55Write-Log -message "Run ResGen (generating C# bindings for resx files)"56Start-ResGen57```5859### 3. Groups Should Represent Independent Operations6061Each group should be a logically independent operation that users might want to expand/collapse separately.6263**✅ Good examples:**64- Install Native Dependencies65- Install .NET SDK66- Build PowerShell67- Restore NuGet Packages6869**❌ Bad examples:**70- Individual project restores (too granular)71- Small code generation steps (too small)72- Sub-steps of a larger operation (would require nesting)7374### 4. One Group Per Iteration Is Excessive7576Avoid putting log groups inside loops where each iteration creates a separate group. This would probably cause nesting.7778**❌ Don't:**79```powershell80$projects | ForEach-Object {81 Write-LogGroupStart -Title "Restore Project: $_"82 dotnet restore $_83 Write-LogGroupEnd -Title "Restore Project: $_"84}85```8687**✅ Do:**88```powershell89Write-LogGroupStart -Title "Restore All Projects"90$projects | ForEach-Object {91 Write-Log -message "Restoring $_"92 dotnet restore $_93}94Write-LogGroupEnd -Title "Restore All Projects"95```9697## Usage Pattern9899```powershell100Write-LogGroupStart -Title "Descriptive Operation Name"101try {102 # ... operation code ...103 Write-Log -message "Status updates"104}105finally {106 # Ensure group is always closed107}108Write-LogGroupEnd -Title "Descriptive Operation Name"109```110111## When to Use Log Groups112113Use log groups for:114- Major build phases (bootstrap, restore, build, test, package)115- Installation operations (dependencies, SDKs, tools)116- Operations that produce 5+ lines of output117- Operations where users might want to collapse verbose output118119Don't use log groups for:120- Single-line operations121- Code that's already inside another group122- Loop iterations with minimal output per iteration123- Diagnostic or debug output that should always be visible124125## Examples from build.psm1126127### Good Usage128129```powershell130function Start-PSBootstrap {131 # Multiple independent operations, each with substantial output132 Write-LogGroupStart -Title "Install Native Dependencies"133 # ... apt-get/yum/brew install commands ...134 Write-LogGroupEnd -Title "Install Native Dependencies"135136 Write-LogGroupStart -Title "Install .NET SDK"137 # ... dotnet installation ...138 Write-LogGroupEnd -Title "Install .NET SDK"139}140```141142### Avoid143144```powershell145# Too small - just 2-3 lines146Write-LogGroupStart -Title "Generate Resource Files (ResGen)"147Write-Log -message "Run ResGen"148Start-ResGen149Write-LogGroupEnd -Title "Generate Resource Files (ResGen)"150```151152## GitHub Actions Syntax153154These functions emit GitHub Actions workflow commands:155- `Write-LogGroupStart` → `::group::Title`156- `Write-LogGroupEnd` → `::endgroup::`157158In the GitHub Actions UI, this renders as collapsible sections with the specified title.159160## Testing161162Test log grouping locally:163```powershell164$env:GITHUB_ACTIONS = 'true'165Import-Module ./build.psm1166Write-LogGroupStart -Title "Test"167Write-Log -Message "Content"168Write-LogGroupEnd -Title "Test"169```170171Output should show:172```173::group::Test174Content175::endgroup::176```177178## References179180- [GitHub Actions: Grouping log lines](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines)181- `build.psm1`: `Write-LogGroupStart` and `Write-LogGroupEnd` function definitions182
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| PowerShell/PowerShell.github/instructions/build-and-packaging-steps.instructions.md · 55k | Copilot instructions | buildagent-behaviour | 58/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/build-checkout-prerequisites.instructions.md · 55k | Copilot instructions | setupbuildstylearch+1 | 81/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/code-review-branch-strategy.instructions.md · 55k | Copilot instructions | lint-formatstyletypesgit+1 | 62/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/instruction-file-format.instructions.md · 55k | Copilot instructions | buildlint-formatstylearch+3 | 76/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/onebranch-condition-syntax.instructions.md · 55k | Copilot instructions | buildstylearchdeployment+1 | 73/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/onebranch-restore-phase-pattern.instructions.md · 55k | Copilot instructions | arch | 54/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/onebranch-signing-configuration.instructions.md · 55k | Copilot instructions | buildstyledeployment | 62/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/powershell-module-organization.instructions.md · 55k | Copilot instructions | buildteststylearch+2 | 69/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/powershell-parameter-naming.instructions.md · 55k | Copilot instructions | styledo-not | 65/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/publishing-pester-result.instructions.md · 55k | Copilot instructions | testlint-formatstylearch+3 | 69/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/script-module-file-format.instructions.md · 55k | Copilot instructions | lint-format | 54/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/start-native-execution.instructions.md · 55k | Copilot instructions | buildstylearchgit+1 | 86/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/start-psbuild-basics.instructions.md · 55k | Copilot instructions | buildtesting-strategydeploymentagent-behaviour | 54/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/troubleshooting-builds.instructions.md · 55k | Copilot instructions | buildgitdeployment | 54/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/build-configuration-guide.instructions.md · 55k | Copilot instructions | buildteststyletesting-strategy+2 | 74/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/pester-set-itresult-pattern.instructions.md · 55k | Copilot instructions | setupstylearch | 62/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/powershell-automatic-variables.instructions.md · 55k | Copilot instructions | stylearchgitdeployment+1 | 69/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/pester-test-status-and-working-meaning.instructions.md · 55k | Copilot instructions | teststyle | 54/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| pytorch/pytorch.github/copilot-instructions.md · 102k | Copilot instructions | setupbuildteststyle+5 | 100/100 | 14 days ago | |
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 63 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 14 days ago | |
| dotnet/roslyn.github/instructions/Compiler.instructions.md · 21k | Copilot instructions | buildteststylearch+3 | 99/100 | 7 days ago | |
| hiyouga/LlamaFactory.github/copilot-instructions.md · 74k | Copilot instructions | setupbuildtestlint-format+5 | 97/100 | 13 days ago | |
| rtk-ai/rtk.github/copilot-instructions.md · 75k | Copilot instructions | buildtestlint-formatstyle+2 | 97/100 | 14 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 14 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 31k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 7 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/powershell-powershell-github-instructions-log-grouping-guidelines-instructions)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.