-
-
Notifications
You must be signed in to change notification settings - Fork 2
07 Workflow Triggers Matrix
The definitive guide to when and how workflows trigger in Zopio - Your single source of truth for all 13 GitHub Actions workflows, their triggers, schedules, and dependencies. Optimized with concurrency controls for 40-50% faster builds.
- β‘ Quick Reference
- π― At a Glance
- ποΈ Core Workflows
- π€ PR Management Workflows
- π§Ή Maintenance Workflows
- π§ Utility Workflows
- π Trigger Types Explained
- π Workflow Dependencies
- βοΈ Concurrency & Optimization
- π Performance Metrics
- π Branch Protection Integration
- π οΈ Manual Triggers
- π¨ Troubleshooting
- π Related Documentation
Essential commands and shortcuts
# View all workflow runs
gh run list --limit 10
# Trigger a workflow manually
gh workflow run <workflow-name> --ref <branch>
# Watch a running workflow
gh run watch
# Cancel a workflow
gh run cancel <run-id>
# Re-run failed jobs
gh run rerun --failed
All 13 workflows visualized by trigger type
flowchart LR
subgraph "Event Triggers"
Push[Push Events]
PR[Pull Request]
Schedule[Scheduled]
Manual[Manual Dispatch]
end
subgraph "Core Workflows (5)"
Build[ποΈ build.yml]
CI[β‘ ci.yml]
Security[π security.yml]
Release[π¦ release.yml]
Changelog[π changelog.yml]
end
subgraph "PR Workflows (3)"
PRVal[β
pr-validation.yml]
Label[π·οΈ label.yml]
Assign[π€ pr-assignment.yml]
end
subgraph "Maintenance (3)"
Welcome[π welcome.yml]
Stale[π§Ή stale.yml]
Lock[π lock-threads.yml]
end
subgraph "Utility (2)"
Docs[π docs.yml]
Setup[π§ setup-node.yml]
end
Push --> CI & Security & Release & Changelog
PR --> Build & CI & Security & PRVal & Label & Assign & Welcome & Docs
Schedule --> Security & Stale & Lock
Manual --> Changelog & Stale & Lock
style Push fill:#4ECDC4
style PR fill:#95E1D3
style Schedule fill:#FFD93D
style Manual fill:#FF6B6B
π Total Workflows
|
β‘ Optimizations
|
π Scheduled Jobs
|
π Security Layers
|
Workflow | File | Triggers | Branches/Conditions | Key Features |
---|---|---|---|---|
Build | build.yml |
- PR opened - PR synchronized - PR reopened |
Target: main
|
- Full monorepo build - Lint, typecheck, test - Bundle analysis - Environment setup - β‘ Concurrency: Yes |
CI | ci.yml |
- Push - Pull request |
Target: develop , staging , release/* , v[0-9]*.[0-9]*
|
- Fast parallel checks - Lint, test, build - π CodeQL security - Graceful failures - β‘ Concurrency: Yes |
Security | security.yml |
- Push - Pull request - Schedule (2 AM UTC) |
Target: main , develop , staging
|
- Comprehensive security scanning - Multiple vulnerability detectors - β Full details - β‘ Concurrency: Yes |
Release | release.yml |
- Push | Target: main
|
- Auto versioning - NPM publishing - GitHub releases - Skip detection ( [ci skip] )- β‘ Concurrency: Yes |
Changelog | changelog.yml |
- Push - Manual dispatch |
Target: main
|
- Conventional commits - Version tagging - GitHub releases - Auto commits - β‘ Concurrency: Yes |
Automated PR handling and validation
Workflow | File | Triggers | Conditions | Key Features |
---|---|---|---|---|
PR Validation | pr-validation.yml |
- PR opened - PR edited - PR synchronized - PR reopened - π― pull_request_target
|
All PRs | - Branch naming rules - Semantic titles - Size limits (1K/5K lines) - Breaking changes check - β‘ Concurrency: Yes |
Auto Label | label.yml |
- PR opened - PR synchronized |
All PRs (via pull_request_target ) |
- Path-based labels - Type from title - Priority detection - Community marking - π·οΈ 41 labels |
Auto Assign | pr-assignment.yml |
- PR opened - PR ready for review |
All PRs | - Assign to author - Team reviewers - Code ownership - Skip drafts - π₯ CODEOWNERS |
ποΈ Branch Naming Patterns
|
π¦ Size Limits Soft limit: 1,000 lines
Hard limit: 5,000 lines
File limit: 100 files π Title Format
|
Automated repository housekeeping
Workflow | File | Triggers | Schedule/Conditions | Key Features |
---|---|---|---|---|
Stale Management | stale.yml |
- Schedule - ποΈ Manual dispatch |
Daily at 1 AM UTC | - Issues: 60d β stale - PRs: 30d β stale - Auto close after warning - Label exemptions - π― 14d/7d grace period |
Lock Threads | lock-threads.yml |
- Schedule - ποΈ Manual dispatch |
Daily at 2 AM UTC π Only for zopiolabs |
- Issues: lock after 90d - PRs: lock after 60d - Prevent necroposting - Add explanation - π Repository check |
Welcome | welcome.yml |
- Issue opened - PR opened |
First-time contributors | - Personal welcome - Resource links - Guidelines - Encouragement - π Different messages |
Never marked stale:
|
Supporting workflows and reusable components
Workflow | File | Triggers | Purpose |
---|---|---|---|
Documentation | docs.yml |
- Push - Pull request |
When only docs files change Validates documentation structure π Checks: README.md, CHANGELOG.md π¦ Section validation |
Setup Node | setup-node.yml |
- π Workflow call | Reusable workflow for Node.js setup Parameters: β’ node-version : '20'β’ pnpm-version : '10.11.0'β’ install-deps : trueβ’ frozen-lockfile : true |
jobs:
example:
uses: ./.github/workflows/setup-node.yml
with:
node-version: '20'
pnpm-version: '10.11.0'
Understanding the 4 main trigger types
When they fire:
|
Common uses: on:
push:
branches:
- main
- develop
tags:
- 'v[0-9]*.[0-9]*' |
Event types:
|
Permission levels: # Standard (read-only)
pull_request:
types: [opened, synchronize]
# Write permissions (for forks)
pull_request_target:
types: [opened, synchronize] |
Our scheduled workflows:
|
Cron syntax: on:
schedule:
# Daily at 2 AM UTC
- cron: '0 2 * * *'
# Weekly on Monday
- cron: '0 3 * * 1' |
Available for:
|
Trigger via CLI: gh workflow run changelog.yml \
--ref main
gh workflow run stale.yml \
--ref main |
Required status checks per branch:
Branch | Required Checks |
---|---|
main |
- Build - Security Scan - PR Validation |
staging |
- CI Pipeline - Security Scan |
develop |
- CI Pipeline |
How workflows interact and depend on each other
flowchart TB
subgraph "Push to Main"
PUSH_MAIN[Push to main] --> CHANGELOG[Changelog Generation]
PUSH_MAIN --> RELEASE[Release Workflow]
RELEASE --> NPM[NPM Publish]
RELEASE --> GH_RELEASE[GitHub Release]
CHANGELOG -.->|provides| GH_RELEASE
end
subgraph "Pull Request Flow"
PR_OPEN[PR Opened] --> PR_VAL[PR Validation]
PR_OPEN --> LABEL[Auto Label]
PR_OPEN --> ASSIGN[Auto Assign]
PR_OPEN --> BUILD[Build Workflow]
PR_OPEN --> CI[CI Pipeline]
PR_OPEN --> SEC_PR[Security Scan]
PR_VAL -->|must pass| MERGE{Can Merge?}
BUILD -->|must pass| MERGE
CI -->|must pass| MERGE
SEC_PR -->|must pass| MERGE
end
subgraph "Scheduled Jobs"
DAILY[Daily Schedule] --> SEC_DAILY[Security Scan]
DAILY --> STALE[Stale Management]
DAILY --> LOCK[Lock Threads]
end
subgraph "First-Time Contributors"
FIRST_ISSUE[First Issue] --> WELCOME_ISSUE[Welcome Message]
FIRST_PR[First PR] --> WELCOME_PR[Welcome Message]
end
style PUSH_MAIN fill:#FF6B6B,color:#fff
style PR_OPEN fill:#4ECDC4
style DAILY fill:#FFD93D
style MERGE fill:#6BCF7F
π¦ Release Chain
|
β PR Requirements
|
π Reusable Components
|
How we achieved 40-50% faster workflows
All major workflows include concurrency management:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Benefits:
- β Automatically cancels outdated runs
- β Prevents duplicate workflow executions
- β Saves GitHub Actions minutes
- β Faster feedback on PRs
Path Filtering paths-ignore:
- '**/*.md'
- 'docs/**'
- 'LICENSE'
- '**/*.txt' Skips workflows for non-code changes |
Conditional Steps - name: Run expensive check
if: github.event_name == 'push' &&
github.ref == 'refs/heads/main' Only runs when necessary |
Before Optimization
|
After Optimization
|
Key Changes
|
Typical workflow execution times and optimization tips
Workflow | Typical Duration | Optimized | Savings |
---|---|---|---|
Build (main) | ~15 min | ~8-10 min | 40% |
CI Pipeline | ~10 min | ~5-7 min | 45% |
Security Suite | ~20 min | ~12-15 min | 35% |
PR Validation | ~2 min | ~30 sec | 75% |
Release | ~8 min | ~3-5 min | 50% |
DO β
|
DON'T β
|
# Check workflow duration trends
gh run list --workflow=ci.yml --limit 20 \\
--json durationMs,conclusion \\
--jq 'map(select(.conclusion==\"success\") |
.durationMs/60000) | add/length'
# Find slow jobs
gh run view <run-id> --json jobs \\
--jq '.jobs | sort_by(.durationMs) | reverse |
.[0:3] | map({name, duration: .durationMs/60000})'
Required status checks for protected branches
Branch | Required Checks | Additional Requirements |
---|---|---|
π main | β’ Build workflow β’ Security scan β’ PR validation β’ 2 reviews |
β’ Up-to-date with base β’ No direct pushes β’ Admin bypass disabled |
π§ͺ staging | β’ CI pipeline β’ Security scan β’ 1 review |
β’ No force pushes β’ No deletions |
π§ develop | β’ CI pipeline β’ 1 review |
β’ No force pushes β’ No deletions |
Build Workflow (main only)
|
CI Pipeline (dev/staging)
|
How to manually trigger workflows
Workflow | Command | Use Case |
---|---|---|
Changelog | gh workflow run changelog.yml --ref main |
Generate changelog on demand |
Stale | gh workflow run stale.yml |
Clean up stale issues/PRs |
Lock Threads | gh workflow run lock-threads.yml |
Lock old discussions |
- Go to Actions tab
- Select workflow from left sidebar
- Click Run workflow dropdown
- Select branch and fill inputs
- Click Run workflow button
# Run with inputs
gh workflow run changelog.yml \
--ref main \
--field version="1.2.3" \
--field skip-commit="false"
# Run on specific branch
gh workflow run stale.yml \
--ref feature/cleanup
Common workflow issues and solutions
Issue | Symptoms | Solution |
---|---|---|
Workflow not triggering | No run appears | β’ Check branch filters β’ Verify path filters β’ Check workflow syntax |
Concurrency cancellation | Run cancelled automatically | β’ Expected behavior β’ Latest push takes priority β’ Check run history |
Permission denied | Error: Resource not accessible |
β’ Check GITHUB_TOKEN permissions β’ Use pull_request_target for forksβ’ Verify repo settings |
Required check missing | Can't merge PR | β’ Re-run failed workflow β’ Check branch protection β’ Verify workflow name |
Schedule not running | Cron job inactive | β’ Must have activity in 60 days β’ Check cron syntax β’ Verify default branch |
# Check workflow syntax
actionlint .github/workflows/*.yml
# View workflow runs
gh run list --workflow=<name>
# Get detailed logs
gh run view <run-id> --log
# Download artifacts
gh run download <run-id>
# Check specific job
gh run view <run-id> --job=<job-id>
Debug workflow triggers - name: Debug trigger
run: |
echo "Event: ${{ github.event_name }}"
echo "Action: ${{ github.event.action }}"
echo "Ref: ${{ github.ref }}" |
Skip a workflow run # In commit message
git commit -m "docs: update [skip ci]"
# Or
git commit -m "chore: cleanup [ci skip]" |
Where to go next for detailed information
|
|
|
π‘ This page is the single source of truth for workflow triggers - For implementation details, see Workflow Details
Need help? Check Troubleshooting | Want to optimize? See Performance Metrics
β¬ Back to Top | β¬ Previous: Pipeline Overview | β‘ Next: Automated Dependencies