Setting up a new module repository using Process-PSModule requires multiple manual steps documented in the README: enabling GitHub Pages, removing branch protection on the github-pages environment, creating a PowerShell Gallery API key, and adding the APIKEY secret. Several open issues (#190, #106, #61, #213, #214, #215, #319) identify additional setup steps that are currently manual.
Request
Current experience
After creating a repository from the Template-PSModule, a maintainer must manually:
- Navigate to repository settings → Pages → set deployment to "GitHub Actions"
- Navigate to the
github-pages environment → remove branch protection for main
- Create an API key on PowerShell Gallery with the correct scope
- Add the
APIKEY secret to the repository (or organization)
- Optionally set repository description, homepage URL, and labels from the module manifest
These steps are error-prone and easily forgotten, leading to failed first publishes and misconfigured repositories.
Desired experience
An idempotent bootstrap workflow (or script) that automates all repository configuration after template instantiation. Running it multiple times produces the same result — it detects current state and only applies changes that are missing.
Acceptance criteria
- GitHub Pages is enabled and configured for GitHub Actions deployment
- The
github-pages environment branch protection is configured correctly
- Repository description is set from the module manifest (if present)
- Repository homepage URL is set to the GitHub Pages URL
- Repository labels are standardized (matching the PSModule label set)
EnforceHttps is enabled on GitHub Pages
- The workflow is idempotent — safe to re-run at any time
- The workflow can be triggered via
workflow_dispatch for initial setup and ad-hoc corrections
Related issues
Technical decisions
Approach: Create a new reusable workflow Bootstrap-Repository.yml (or a composite action) that uses the GitHub API to configure repository settings. This workflow runs via workflow_dispatch and can optionally be called from the main workflow.yml on first successful publish.
API endpoints needed:
Idempotency: Each step checks current state before mutating. For example, if Pages is already enabled with the correct source, the step is a no-op.
Permissions: The workflow needs administration: write (for Pages/environment config) and contents: read (for reading the manifest). This is a privileged operation, which is appropriate for a one-off admin workflow triggered manually.
Scope of this issue: This issue covers the bootstrap workflow itself. The individual test issues (#213, #214, #215) remain valid as ongoing validation that the configuration has not drifted.
Implementation plan
Bootstrap workflow
Documentation
Testing
Setting up a new module repository using Process-PSModule requires multiple manual steps documented in the README: enabling GitHub Pages, removing branch protection on the
github-pagesenvironment, creating a PowerShell Gallery API key, and adding theAPIKEYsecret. Several open issues (#190, #106, #61, #213, #214, #215, #319) identify additional setup steps that are currently manual.Request
Current experience
After creating a repository from the Template-PSModule, a maintainer must manually:
github-pagesenvironment → remove branch protection formainAPIKEYsecret to the repository (or organization)These steps are error-prone and easily forgotten, leading to failed first publishes and misconfigured repositories.
Desired experience
An idempotent bootstrap workflow (or script) that automates all repository configuration after template instantiation. Running it multiple times produces the same result — it detects current state and only applies changes that are missing.
Acceptance criteria
github-pagesenvironment branch protection is configured correctlyEnforceHttpsis enabled on GitHub Pagesworkflow_dispatchfor initial setup and ad-hoc correctionsNote
This aligns with Twelve-Factor App Factor XII (Admin processes): "Run admin/management tasks as one-off processes." Repository bootstrap is a classic admin process that should be codified, not documented as manual steps.
Related issues
Technical decisions
Approach: Create a new reusable workflow
Bootstrap-Repository.yml(or a composite action) that uses the GitHub API to configure repository settings. This workflow runs viaworkflow_dispatchand can optionally be called from the mainworkflow.ymlon first successful publish.API endpoints needed:
PATCH /repos/{owner}/{repo}— set description, homepage, has_pagesPOST /repos/{owner}/{repo}/pages— enable Pages with Actions sourcePUT /repos/{owner}/{repo}/environments/{environment_name}— configure environment protection rulesGET/PUT /repos/{owner}/{repo}/labels— sync labelsIdempotency: Each step checks current state before mutating. For example, if Pages is already enabled with the correct source, the step is a no-op.
Permissions: The workflow needs
administration: write(for Pages/environment config) andcontents: read(for reading the manifest). This is a privileged operation, which is appropriate for a one-off admin workflow triggered manually.Scope of this issue: This issue covers the bootstrap workflow itself. The individual test issues (#213, #214, #215) remain valid as ongoing validation that the configuration has not drifted.
Implementation plan
Bootstrap workflow
Bootstrap-Repository.ymlwithworkflow_dispatchtriggergithub-pagesenvironment protection rulesEnforceHttpson GitHub PagesDocumentation
Testing