Repository Initialization Workflow
The repository initialization workflow transforms a newly created repository from the OSDU Azure SPI Management template into a fully functional fork management system. This workflow handles all the complex setup tasks automatically, including deploying the complete workflow suite, creating the three-branch architecture, configuring security settings, and validating that everything is working correctly before your team begins development.
The initialization process is designed with a two-phase approach that separates the immediate user experience from the more time-consuming system configuration tasks. This ensures you get immediate feedback that setup has started successfully, while the detailed configuration work happens in the background without requiring you to wait or monitor the process.
When It Runs
The initialization workflow activates in several scenarios to ensure your repository is properly configured:
- Template creation - Automatically triggers when you create a new repository from this template
- Manual trigger - Available via GitHub Actions tab if setup needs to be rerun or troubleshooting is required
- Fork creation - Activates when forking an existing OSDU SPI repository to ensure proper configuration
What Happens
The initialization process unfolds in two coordinated phases designed to provide optimal user experience while ensuring thorough setup:
Immediate Setup Phase (30 seconds)
The workflow immediately creates a setup issue that serves as a tracking mechanism for initialization progress, validates that all required template files are present and properly formatted, triggers the main configuration workflow to begin the detailed setup process, and provides immediate feedback through the setup issue so you know the process has started successfully.
Full Configuration Phase (5-10 minutes)
The comprehensive setup process deploys all workflow files including sync, cascade, build, validation, and release management workflows to your repository. It creates the essential fork_upstream and fork_integration branches that form the foundation of the three-branch architecture, applies branch protection rules and security settings to ensure safe collaboration, enables repository features like issues and discussions that support the fork management process, and validates the entire setup by running initial checks to confirm everything is functioning correctly.
The initialization process produces clear outcomes to guide your next steps: - Success: Your repository is fully configured and ready for upstream synchronization and team development - Failure: The setup issue is updated with specific resolution steps and guidance for addressing any configuration problems
When You Need to Act
Required Configuration
- Repository secrets - Must be configured before first sync
- Upstream repository - Must specify which repository to sync from
- Team permissions - Ensure team has appropriate access levels
Optional Configuration
- AI providers - Configure API keys for enhanced PR descriptions
- Notifications - Set up issue/PR notifications for your team
- Custom labels - Add project-specific labels beyond defaults
How to Respond
Complete Required Setup
- Check setup issue - Look for repository configuration checklist
-
Configure secrets:
-
Verify branch protection - Ensure
mainbranch is protected - Test initial sync - Run upstream sync workflow manually to verify setup
Handle Setup Failures
# Check workflow logs in Actions tab
# Common issues and solutions:
# Permission errors
# - Ensure repository has Actions write permissions
# - Check team has admin access to repository
# Branch creation failures
# - Verify default branch is 'main'
# - Check for existing conflicting branches
# Workflow deployment issues
# - Ensure Actions are enabled in repository settings
# - Verify no conflicting workflow files exist
Verify Successful Setup
- Check branches - Should have
main,fork_upstream,fork_integration - Test workflows - All workflows should be visible in Actions tab
- Verify protection - Branch protection rules should be active
- Run sync test - Manual upstream sync should work without errors
Repository Structure Created
Branches
main- Your production branch (protected)fork_upstream- Mirror of upstream repositoryfork_integration- Integration and conflict resolution branch
Workflows Installed
sync.yml- Daily upstream synchronizationcascade.yml- Three-branch integration processbuild.yml- Build and test automationvalidate.yml- PR quality gatesrelease.yml- Automated version management
Security Configuration
- Branch protection - Required PR reviews and status checks
- Action permissions - Appropriate workflow execution permissions
- Issue templates - Standardized issue reporting
- Security scanning - Dependabot and vulnerability detection
Required Secrets
| Secret | Purpose | Required |
|---|---|---|
UPSTREAM_REPO_URL | Repository to sync from | ✅ Yes |
GITHUB_TOKEN | Automatically provided | ✅ Yes |
AZURE_API_KEY | AI-enhanced PR descriptions | ❌ Optional |
AZURE_API_BASE | Azure Foundry endpoint | ❌ Optional |
AZURE_API_VERSION | Azure API version | ❌ Optional |
Troubleshooting
| Issue | Solution |
|---|---|
| "Setup issue not created" | Check Actions are enabled, rerun workflow |
| "Branch creation failed" | Verify default branch is 'main', check permissions |
| "Workflow deployment error" | Remove conflicting .github/workflows/ files |
| "Protection rules failed" | Ensure admin access, check repository settings |
| "Initial sync fails" | Verify UPSTREAM_REPO_URL secret is correct |
Post-Setup Checklist
- Setup issue closed successfully - Initialization completed without errors
- Three branches exist -
main,fork_upstream,fork_integration - Workflows active - All 5 workflows visible in Actions tab
- Secrets configured - At minimum
UPSTREAM_REPO_URLis set - Protection enabled -
mainbranch requires PR reviews - Initial sync works - Manual upstream sync runs successfully
- Team permissions - Team has appropriate repository access
Next Steps
- Configure upstream sync - Set
UPSTREAM_REPO_URLto target repository - Run first sync - Manually trigger upstream synchronization workflow
- Set up notifications - Configure team alerts for sync issues and PRs
- Review documentation - Read synchronization and cascade workflows
- Add team members - Invite collaborators with appropriate permissions
Related
- Synchronization Workflow - Next step after initialization
- Three-Branch Strategy - Branching architecture
- Security Setup - Security configuration details