CI/CD Workflows
GitHub Actions workflows that power continuous integration and deployment for Portfolio OS
Overview
Portfolio OS uses GitHub Actions to automate continuous integration, testing, and deployment across the monorepo.
These workflows are event-driven and designed to work together as a single pipeline from issue creation through deployment.
graph LR
A[Issue Events] --> B[Issue Workflows]
B --> C[PR Events]
C --> D[PR Workflows]
D --> E[CI Pipeline]
E --> F[E2E Tests]
F --> G[Deployment]
style A fill:#e3f2fd
style B fill:#bbdefb
style C fill:#90caf9
style D fill:#64b5f6
style E fill:#42a5f5
style F fill:#2196f3
style G fill:#1976d2,color:#fff
This page documents the key workflows, how they are triggered, and how they interact with the automation scripts and project configuration.
Note:
All workflow files live in .github/workflows/ and are triggered automatically by GitHub events or can be run manually via workflow_dispatch.
Workflow Catalog
Issue & PR Orchestration
Complete issue-to-PR lifecycle automation
CI Pipeline
Build, lint, typecheck, and test
E2E Testing
Playwright-powered end-to-end tests
Conflict Management
Automatic conflict detection and resolution
Issue & PR Orchestration
orchestrate-issues-prs.yml
Core Orchestration:
This is the central workflow that coordinates issue creation, branch management, PR creation, and review automation.
File: .github/workflows/orchestrate-issues-prs.yml
Purpose: Orchestrates the complete issue → branch → PR lifecycle using automation scripts.
Triggers:
issuesevents:opened,edited,closedpull_requestevents:opened,synchronize,closed,review_requested,review_request_removedworkflow_dispatchwithissue_numberinput for manual re-runs
Key Responsibilities:
- Auto-configure new/updated issues (project fields, labels, priority, size)
- Create branches from
developfor selected issues - Create draft PRs and attach them to the correct project, app, and area
- Kick off CR-GPT / PR automation scripts for analysis and feedback handling
Primary Scripts Called:
scripts/issue-management/auto-configure-issues.ps1scripts/branch-management/create-branch-from-develop.ps1scripts/issue-management/issue-implementation.ps1scripts/pr-management/universal-pr-automation-simple.ps1
PR Automation & Review
pr-automation-optimized.yml
- File:
.github/workflows/pr-automation-optimized.yml - Purpose: Handles PR configuration, quality checks, CR-GPT review integration, and status updates.
- Triggers:
pull_requestevents:opened,synchronize,reopened,ready_for_review,review_requested,review_request_removedworkflow_dispatchwithpr_numberinput
- Key Responsibilities:
- Analyze PR metadata (base branch, change scope).
- Run code-quality and test scripts for the given PR.
- Trigger CR-GPT-based review automation.
- Update GitHub Projects fields and status based on results.
- Primary Scripts Called:
scripts/pr-management/code-quality-checker.ps1scripts/pr-management/universal-pr-automation-simple.ps1scripts/project-management/project-status-monitor.ps1
Issue Auto-Configuration
auto-configure-issues-optimized.yml
- File:
.github/workflows/auto-configure-issues-optimized.yml - Purpose: Automatically configures newly created or edited issues with consistent metadata.
- Triggers:
issuesevents:opened,editedworkflow_dispatchwithissue_numberinput
- Key Responsibilities:
- Analyze issue title and body to infer type (bug/feature/docs/infra).
- Set priority (
P0–P3), size (XS–XL), app (Site/Dashboard/Docs), and area (Frontend/Backend/Infra/Content). - Apply default labels and add the issue to the appropriate GitHub Project.
- Primary Scripts Called:
scripts/issue-management/auto-configure-issues.ps1
Core CI Pipeline
ci-optimized.yml
- File:
.github/workflows/ci-optimized.yml - Purpose: Core CI pipeline for building, linting, type-checking, and testing apps in the monorepo.
- Triggers:
pull_requestevents (e.g.,opened,synchronize,reopened,ready_for_review)- Path filters:
apps/**packages/**.github/workflows/**
- Path filters:
pushevents todevelop- Path filters:
apps/**packages/**.github/workflows/**
- Path filters:
- Key Responsibilities:
- Detect which apps/packages changed and only run jobs for those targets.
- Run linting, TypeScript checks, unit tests, and build steps.
- Cache dependencies and build artifacts for faster CI runs.
- Typical Jobs:
- Path detection: decide whether
siteand/ordashboardneed to run. - Matrix build for
siteanddashboardusing Turbo/PNPM. - Quality gates: lint, type-check, unit tests, optional security checks.
- Path detection: decide whether
PR Conflict Guard
pr-conflict-guard.yml
- File:
.github/workflows/pr-conflict-guard.yml - Purpose: Protects the main branches by detecting and attempting to resolve merge conflicts early.
- Triggers:
pull_requestevents:opened,synchronize,reopened
- Key Responsibilities:
- Check PR mergeability against the base branch.
- Attempt a safe auto-rebase when conflicts are detected.
- Provide early feedback to authors when manual intervention is required (especially around lockfiles).
- Typical Logic:
- Inspect
github.event.pull_request.base.ref. - Try a rebase onto the base branch.
- If rebase fails, detect common conflict patterns (e.g.,
pnpm-lock.yaml,package-lock.json,yarn.lock) and leave clear logs for the author.
- Inspect
E2E Testing
e2e-optimized.yml
- File:
.github/workflows/e2e-optimized.yml - Purpose: Runs Playwright end-to-end tests for the portfolio site and dashboard.
- Triggers:
pull_requestevents on:apps/site/**apps/dashboard/**
pushevents todevelopwhenapps/site/**orapps/dashboard/**change
- Key Responsibilities:
- Install Playwright and required browsers.
- Run the E2E test suite (often against a preview deployment URL).
- Publish reports (e.g., HTML report) as artifacts.
- Typical Jobs:
- Setup: checkout, Node/PNPM install, Playwright install.
- Run tests:
npx playwright test --reporter=html. - Artifacts: upload Playwright report for debugging failures.
How Workflows Interact
High-Level Flow
- Issue created/edited
auto-configure-issues-optimized.ymlsets project fields, labels, and routing.orchestrate-issues-prs.ymlmay create branches and draft PRs.
- PR opened/updated
orchestrate-issues-prs.ymlandpr-automation-optimized.ymlhandle configuration, assignments, and CR-GPT automation.ci-optimized.ymlruns core CI checks (lint, tests, build).e2e-optimized.ymlruns Playwright E2E tests for site and dashboard.pr-conflict-guard.ymlchecks mergeability and attempts safe rebase.
- Merge & deployment
- Deployment workflows (documented separately if present) consume build artifacts and test results from CI/E2E pipelines.
This design keeps each workflow focused while allowing them to form a coordinated pipeline.
Environment Variables & Secrets
Required Secrets
These secrets are typically required across workflows:
-
GITHUB_TOKEN/GH_TOKEN- Purpose: Authenticate GitHub CLI and API calls.
- Provided by GitHub:
secrets.GITHUB_TOKENis auto-injected. - Usage:
- Updating issues and PRs.
- Managing project fields.
- Fetching repository metadata.
-
PROJECT_ID- Purpose: Identifies the GitHub Project used for automation.
- Used by: Issue/PR orchestration workflows when configuring project board fields.
Common Environment Variables
Workflows commonly set additional environment variables, for example:
NODE_VERSION: Node.js version used in CI (e.g.,20).PNPM_VERSION: PNPM version used by the monorepo.MAX_CONCURRENT_JOBS: Limits parallel CI jobs.CACHE_TIMEOUT: Cache expiration for dependency/build caches.
Exact values live in the respective workflow files and can be adjusted per project needs.
Permissions
Typical workflow-level permissions:
permissions:
contents: read
issues: write
pull-requests: write
actions: read
checks: write
These permissions allow workflows to update issues and PRs, manage checks, and read repository contents while keeping scope constrained.
Common Issues & Troubleshooting
Workflow Fails on Permissions
- Symptoms:
- Errors mentioning insufficient permissions for updating issues/PRs or checks.
- Checks:
- Confirm the
permissionsblock includesissues: write,pull-requests: write, andchecks: write. - Ensure the workflow is using
${{ secrets.GITHUB_TOKEN }}and not an expired PAT.
- Confirm the
Issues Not Being Auto-Configured
- Symptoms:
- New issues do not get labels, priority, or project fields.
- Checks:
- Verify
auto-configure-issues-optimized.ymlis enabled and listening toissues: [opened, edited]. - Confirm
PROJECT_ID(or equivalent project-related secrets/vars) is set. - Check workflow logs for parsing errors in the auto-configuration script.
- Verify
PRs Skipping CI or E2E
- Symptoms:
- PRs are opened but
ci-optimized.ymlore2e-optimized.ymldo not run.
- PRs are opened but
- Checks:
- Confirm changed files match the
pathsfilters (e.g., changes underapps/site/**orapps/dashboard/**). - Ensure the workflow YAML includes the relevant
pull_requestevent types.
- Confirm changed files match the
Frequent Merge Conflicts
- Symptoms:
- PRs frequently show as unmergeable or fail during rebase.
- Checks:
- Verify
pr-conflict-guard.ymlis enabled and running on PR updates. - Investigate whether long-lived branches or lockfile churn are causing conflicts.
- Encourage smaller, more focused PRs to reduce conflict surface area.
- Verify
When to Use Each Workflow
auto-configure-issues-optimized.yml: Anytime issues are created/edited; keeps project metadata consistent.orchestrate-issues-prs.yml: When you want a full issue → branch → PR automation flow.pr-automation-optimized.yml: For PR-centric automation: configuration, quality checks, CR-GPT integration.ci-optimized.yml: Core CI for apps and packages; runs on most PRs and pushes todevelop.pr-conflict-guard.yml: For early detection and mitigation of merge conflicts.e2e-optimized.yml: For validating portfolio site and dashboard behavior with Playwright before merging or deploying.
Together, these workflows provide a robust CI/CD backbone that keeps Portfolio OS reliable while minimizing manual coordination work.