Overview
When a new repository is created from a template, the workflow:- Detects initial commit
- Sets up project configuration
- Baselines service version
- Provisions Python project structure
Workflow Triggers
The provisioning workflow is triggered on:- Initial Push: First push to develop branch
- Manual Trigger: Via workflow_dispatch
- It’s the first workflow run (
github.run_number == 1) - The pusher name starts with
gc-tfrw-(Terraform workflow bot)
Provisioning Process
1. Project Setup
The workflow sets up the project:- Authentication: Uses GitHub App for authentication
- Repository Access: Checks out code with proper permissions
- Token Generation: Creates GitHub token for subsequent steps
2. Python Project Provisioning
The workflow provisions the Python project:- Package Configuration: Sets up package name based on repository name
- Project Structure: Creates standard Python project structure
- Version Baseline: Sets initial version in project files
Workflow Flowchart
Workflow Configuration
The repository provisioning workflow is defined in.github/workflows/repository-provisioning.yaml:
[!TIP] See the Configurations page for complete setup instructions and required secrets.
Configuration
Required Secrets
The workflow requires these secrets:GIT_GITHUB_APP_PEM_FILE: GitHub App private keyGIT_GITHUB_APP_ID: GitHub App ID
Workflow Conditions
The workflow only runs when:github.run_number == 1: First workflow runstartsWith(github.event.pusher.name, 'gc-tfrw-'): Pushed by Terraform workflow
Provisioning Steps
Setup Project
Thesetup-project action:
- Authenticates using GitHub App
- Checks out repository code
- Generates GitHub token for subsequent steps
- Sets up project environment
Provision Python Project
Theprovision-python-project action:
- Creates Python package structure
- Sets package name from repository name
- Configures project files
- Baselines version information
What Gets Provisioned
The workflow provisions:- Package Structure: Standard Python package layout
- Configuration Files: Project configuration files
- Version Information: Initial version baseline
- Project Metadata: Repository name and metadata
Best Practices
- Template Usage: Create repositories from templates for automatic provisioning
- Secret Configuration: Ensure GitHub App secrets are configured
- First Commit: Push initial commit to develop branch
- Verification: Verify provisioning completed successfully
Troubleshooting
Workflow Not Running
If the workflow doesn’t run:- Check Run Number: Ensure it’s the first workflow run
- Verify Pusher: Check if pusher name starts with
gc-tfrw- - Branch Check: Ensure push is to develop branch
- Manual Trigger: Use workflow_dispatch if needed
Provisioning Failures
Common issues:- Authentication: Verify GitHub App credentials
- Permissions: Check repository permissions
- Secrets: Ensure secrets are properly configured
- Timeout: Workflow times out after 10 minutes