Skip to main content

GitHub Repository Promotion PowerShell Script

🧰 Shelvera CI/CD Stress Test PowerShell Source

This page provides the maintained PowerShell automation source used to validate and promote Shelvera repositories through the controlled branch flow: local → dev → qa → prod → main → local.

Safety Validated FlowSequential Repository ProcessingPipeline Stress-Test CapablePowerShell 5.1+

1. Purpose of This Script​

# Anchor

The PowerShell automation supports controlled Shelvera promotion and CI/CD stress testing across selected repositories. It is designed to:

  • Validate repositories using a safe dry-run operation.
  • Promote committed changes through local, dev, qa, prod, and main.
  • Create a controlled pipeline-stress-test.txt marker commit only when the selected execution mode requires it.
  • Force pipeline testing even when branches are already synchronized.
  • Block unexpected downstream divergence as REVIEW REQUIRED.
  • Process repositories sequentially with configurable delays.
  • Protect the ts-001 parent repository from accidentally tracking its independently managed nested repositories.

Related command-builder page: Use your CI/CD Stress Test and Automation page to generate the correct copy-ready execution command before running this script.

2. Add the Script File to Docusaurus​

# Anchor

Create the following folder and file under your Docusaurus project:

PowerShell Static Asset File
static\scripts\powershell\ts_git_commit_automation.ps1

Paste the full PowerShell script into that file exactly as maintained in your local automation folder.

Why the script is stored separately

The script contains extensive PowerShell line-continuation backticks, quoted paths, multiline strings, and Git command arguments. Keeping it as a raw .ps1 static asset avoids escaping problems that can occur when thousands of PowerShell lines are inserted into a JavaScript template literal inside MDX. The page still displays the complete script through CustomCodeBlock.

3. Script File Naming​

# Anchor

Use the same script filename referenced by your command-builder page:

Recommended Script Filename
ts_git_commit_automation.ps1

The script's internal help examples currently refer to:

Name Present Inside the Script Help Examples
Invoke-ShelveraSequentialPromotionTest.ps1

This does not prevent the script from running under ts_git_commit_automation.ps1. However, for long-term consistency, you may later standardize the .EXAMPLE names inside the script to match the actual filename used by your command-builder page.

4. Safety Characteristics​

# Anchor
  • Requires exactly one operation mode: -DryRun or -CreateTestCommit.

  • Supports -ForcePipelineStressTest without bypassing branch safety or divergence validation.

  • Stages and commits only pipeline-stress-test.txt.

  • Never executes git add . or git add -A.

  • Processes repositories sequentially and supports configurable branch and repository delays.

  • Stops on unexpected downstream commits by reporting REVIEW REQUIRED.

  • Supports transcript generation for later operational review.

  • Includes special parent-repository protection for ts-001.

Actual execution

A command containing -CreateTestCommit -ForcePipelineStressTest intentionally creates and pushes a marker commit and can trigger deployments through multiple branches. Use the dry-run command from your command-builder page first.

5. Complete PowerShell Script​

# Anchor
Script Source Information
This page loads the exact PowerShell source file from the Docusaurus static assets folder and renders it below in a copy-ready CustomCodeBlock.
Script File
ts_git_commit_automation.ps1
Load Status
Loading source…
Lines
—
Characters
—
Approx. Size
—
Complete PowerShell Source
Copy this script exactly as displayed. Do not remove line continuation backticks or modify safety validation unless you are intentionally changing the automation behavior.
Waiting for Source
# Loading Shelvera PowerShell automation source…

6. Verification After Adding the Page​

# Anchor

After adding the MDX page and static .ps1 asset, verify the following:

VerificationExpected Result
Documentation page loadsNo MDX compile or rendering error
Script metadata cardStatus displays Loaded successfully
Script line displayFull PowerShell source appears in CustomCodeBlock
Copy controlCopies the complete script source
Download Raw .ps1 File buttonDownloads or opens the PowerShell script file
Existing command-builder pageContinues generating commands without any changes
PowerShell script sourcePreserves all original backticks, quoted paths and safety checks

7. Usage Flow​

# Anchor

Use the two documentation pages together:

  1. Open the CI/CD Stress Test and Automation command-builder page.
  2. Select the repositories and desired safe-preview options.
  3. Copy and run the generated preview command.
  4. Review the result and transcript output.
  5. Return to the command-builder page and copy the matching execution command only when the preview is clean.
  6. Use this page whenever you need to review, copy, download or restore the PowerShell automation source.

Recommended documentation structure: Keep the command generator page focused on operational execution, and keep this companion page focused on the maintained PowerShell source. This makes both pages easier to use and easier to update safely.