GitHub Workflows - Sequential Orchestration
Overview
Section titled “Overview”This repository uses a sequential orchestrated workflow to automate releases following semantic versioning principles.
Workflow Architecture
Section titled “Workflow Architecture”Workflow Details
Section titled “Workflow Details”1. Validate PR (1-validate.yml)
Section titled “1. Validate PR (1-validate.yml)”Trigger: Pull request opened/updated
Purpose: Run quality checks before merging
Jobs:
- Lint, test, type-check, build
- Security scanning (Trivy)
- PR size analysis
Outputs: Pass/fail status for PR approval
2. Version Update (2-version-update.yml)
Section titled “2. Version Update (2-version-update.yml)”Trigger: Push to main (after PR merge)
Purpose: Analyze commits and create version bump PR
Jobs:
- Analyze commits with conventional commit patterns
- Determine version bump (MAJOR/MINOR/PATCH)
- Update package.json
- Create version bump PR
Outputs: New PR with version update
Protection: Skips if commit is workflow-generated (prevents loops)
3. Auto-Merge (3-auto-merge.yml)
Section titled “3. Auto-Merge (3-auto-merge.yml)”Trigger: PR opened/updated, checks completed
Purpose: Automatically merge version bump PRs
Conditions:
- PR title matches:
chore: bump version to v* - PR author is
github-actions[bot] - PR branch starts with
version-bump/ - All checks pass
Jobs:
- Verify PR is version bump
- Check all status checks passed
- Enable auto-merge with squash
Outputs: Merged version bump PR
4. Create Tag (4-create-tag.yml)
Section titled “4. Create Tag (4-create-tag.yml)”Trigger: Push to main with package.json changes
Purpose: Create git tag from package.json version
Jobs:
- Verify commit is version bump
- Read version from package.json
- Create annotated git tag (v*)
- Push tag to remote
Outputs: New git tag
Protection: Only runs for version bump commits, checks if tag exists
5. Publish Release (5-publish.yml)
Section titled “5. Publish Release (5-publish.yml)”Trigger: Tag pushed (v*)
Purpose: Publish npm package, deploy docs, create GitHub release
Jobs:
-
publish-npm
- Verify package.json matches tag
- Run full test suite
- Publish to npm with provenance
- Verify publication
-
publish-docs
- Build Astro documentation
- Deploy to
docsbranch
-
create-release
- Generate changelog from commits
- Create GitHub release with links
Outputs:
- npm package published
- Documentation deployed
- GitHub release created
6. Cleanup (6-cleanup.yml)
Section titled “6. Cleanup (6-cleanup.yml)”Trigger: After publish workflow completes, weekly schedule, manual
Purpose: Maintain clean repository
Jobs:
-
cleanup-releases
- Keep 5 most recent major versions
- Keep 10 releases for current major
- Keep 1 release for older majors
- Delete old releases and tags
-
cleanup-branches
- Delete branches merged >1 day ago
- Skip protected branches (main, docs, etc.)
- Clean up local tracking branches
Outputs: Clean repository with relevant history
Complete Flow Example
Section titled “Complete Flow Example”Scenario: New Feature Added
Section titled “Scenario: New Feature Added”1. Developer creates PR with "feat: add new feature" → 1-validate.yml runs (lint, test, build)
2. PR approved and merged to main → 2-version-update.yml analyzes commits → Determines MINOR version bump needed → Creates PR: "chore: bump version to v1.1.0"
3. Version bump PR created → 1-validate.yml runs on version PR → 3-auto-merge.yml monitors checks → All checks pass → auto-merge enabled → PR merged with squash
4. Version bump PR merged → 4-create-tag.yml detects version commit → Creates tag v1.1.0 → Pushes tag to remote
5. Tag v1.1.0 pushed → 5-publish.yml triggered → Publishes @pantheon-ai/opencode-warcraft-notifications@1.1.0 to npm → Deploys documentation to docs branch → Creates GitHub release v1.1.0
6. Publish complete → 6-cleanup.yml triggered → Cleans up old releases (if >10 for current major) → Deletes merged version-bump branchResult: New version published to npm, docs updated, release created
Version Determination Rules
Section titled “Version Determination Rules”Conventional Commit Analysis
Section titled “Conventional Commit Analysis”The workflow uses conventional commit patterns to determine version bumps:
| Commit Pattern | Version Bump | Example |
|---|---|---|
BREAKING CHANGE: or !: | MAJOR | feat!: change API |
feat: or feature: | MINOR | feat: add new sound |
fix: or bugfix: | PATCH | fix: correct path |
docs:, chore:, refactor:, etc. | PATCH | docs: update README |
Manual Override
Section titled “Manual Override”You can force a specific version bump:
# Trigger workflow manually with specific version typegh workflow run 2-version-update.yml -f version_type=majorWorkflow Configuration
Section titled “Workflow Configuration”Required Secrets
Section titled “Required Secrets”| Secret | Purpose | Required For |
|---|---|---|
GITHUB_TOKEN | Built-in token | All workflows (auto) |
WORKFLOW_PAT | Personal access token | Push commits, create tags |
NPM_TOKEN | npm authentication | Publishing packages |
CODECOV_TOKEN | Coverage reporting | Test coverage upload |
Repository Settings
Section titled “Repository Settings”Required Settings (enforced by repo-config-check workflow):
- ✅ Allow squash merging (required)
- ❌ Allow merge commits (disabled)
- ❌ Allow rebase merging (disabled)
- ✅ Automatically delete head branches (enabled)
Why: Ensures one commit per PR = one version bump = one release
Preventing Workflow Loops
Section titled “Preventing Workflow Loops”Protection Mechanisms
Section titled “Protection Mechanisms”-
Commit Message Detection
- Workflows skip if commit starts with
chore: bump version - Workflows skip if commit contains
[skip ci]
- Workflows skip if commit starts with
-
Branch Name Filtering
- Only specific branches trigger workflows
version-bump/*branches handled specially
-
Tag Existence Checks
- Before creating tag, check if already exists
- Skip if tag found locally or remotely
-
PR Existence Checks
- Before creating version PR, check if already exists
- Skip if branch or PR found
Troubleshooting
Section titled “Troubleshooting”Workflow Not Triggering
Section titled “Workflow Not Triggering”Problem: Version update workflow doesn’t run after PR merge
Solutions:
- Check commit message doesn’t contain
[skip ci] - Verify commit modified files outside
paths-ignore - Check workflow is enabled in Actions tab
Auto-Merge Not Working
Section titled “Auto-Merge Not Working”Problem: Version bump PR not auto-merging
Solutions:
- Verify
WORKFLOW_PAThas sufficient permissions - Check all status checks passed (not just some)
- Verify PR title matches pattern exactly
- Check auto-merge is enabled for repository
Version Mismatch
Section titled “Version Mismatch”Problem: package.json version doesn’t match tag
Solutions:
- This should not happen with new workflow structure
- If it does, manually update package.json
- Re-run 4-create-tag workflow
Tag Already Exists
Section titled “Tag Already Exists”Problem: Tag creation fails because tag exists
Solutions:
- Workflow should skip gracefully
- If tag is wrong, delete it:
git push --delete origin v1.0.0 - Re-run workflow
Comparison: Old vs New Workflow
Section titled “Comparison: Old vs New Workflow”Old Workflow Issues
Section titled “Old Workflow Issues”- ❌ Version bump happened BEFORE PR: No review process
- ❌ AI dependency broken: Gemini CLI installation failed
- ❌ Redundant sync workflow: Created additional PRs
- ❌ Race conditions: Multiple workflows modifying same files
- ❌ Complex orchestration: Hard to follow flow
New Workflow Benefits
Section titled “New Workflow Benefits”- ✅ Clear sequential flow: Easy to understand and debug
- ✅ Version bump via PR: Reviewable and auditable
- ✅ No AI dependency: Uses proven conventional commits
- ✅ No redundancy: Single purpose per workflow
- ✅ Loop prevention: Multiple safeguards
- ✅ Idempotent: Safe to re-run workflows
Monitoring
Section titled “Monitoring”GitHub Actions Tab
Section titled “GitHub Actions Tab”Check workflow status at:
https://github.com/pantheon-org/opencode-warcraft-notifications/actions
Expected Run Times
Section titled “Expected Run Times”| Workflow | Average Duration |
|---|---|
| 1-validate | 2-3 minutes |
| 2-version-update | 30 seconds |
| 3-auto-merge | 10 seconds |
| 4-create-tag | 10 seconds |
| 5-publish | 4-5 minutes |
| 6-cleanup | 1-2 minutes |
Total: ~10 minutes from PR merge to published release
Maintenance
Section titled “Maintenance”Weekly Tasks (Automated)
Section titled “Weekly Tasks (Automated)”- Sunday 2 AM UTC: Cleanup old releases and branches
- Monday 9 AM UTC: Check repository configuration
Monthly Tasks (Manual)
Section titled “Monthly Tasks (Manual)”- Review workflow logs for errors
- Update workflow dependencies
- Verify npm packages published correctly
References
Section titled “References”Last Updated: 2025-11-11
Maintained By: Pantheon AI Team