Public/Install-CCReleaseWorkflow.ps1
|
function Install-CCReleaseWorkflow { <# .SYNOPSIS Generates CI and release workflow files for the detected technology into the repository. .DESCRIPTION Writes .github/workflows/*.yml from the technology provider's templates (PowerShell or .NET), recording them in .codecompass/manifest.yml. Idempotent and safe to re-run. -Adopt enrols existing workflow files as governed-but-unchanged ('adopted') instead of writing. -PullRequest converges the workflows on a new branch and opens a pull request (requires gh) rather than writing to the working tree. Supports -WhatIf and -Force. .EXAMPLE Install-CCReleaseWorkflow -Path . .EXAMPLE Install-CCReleaseWorkflow -Path . -Adopt .EXAMPLE Install-CCReleaseWorkflow -Path . -PullRequest #> [CmdletBinding(SupportsShouldProcess)] [OutputType([pscustomobject])] param( [Parameter(Position = 0)] [string]$Path = '.', [switch]$Force, [switch]$Adopt, [switch]$PullRequest, [string]$Branch = 'codecompass/adopt-release-workflows' ) if ($PullRequest) { return Invoke-CCWorkflowPullRequest -Path $Path -Branch $Branch -Cmdlet $PSCmdlet } Invoke-CCWorkflowSync -Path $Path -Force:$Force -Adopt:$Adopt -Cmdlet $PSCmdlet } |