GitHub Workflows
This document provides an overview of all GitHub Actions workflows defined in this repository under .github/workflows/.
The goal is to explain:
- What each workflow does (raw descriptions from issue)
- Why it was created
- How to use or troubleshoot it
- What secrets or environment variables it depends on
- Executed flow for better understanding of the steps
📂 Location
All workflows live in the .github/workflows/ folder.
Major Workflows
1. build_container.yml
- Description: Builds and pushes Docker images for the API and the web UI to GitHub’s container registry whenever a version tag is pushed or a release is published.
- Why: Provides reproducible, versioned container images for deployments.
- Executed Flow:
- Checkout repository
- Log in to GitHub Container Registry (GHCR)
- Build Docker images (API + Web UI)
- Push images to GHCR
- Secrets/Dependencies:
GITHUB_TOKEN(ensurepermissions: packages: write) or a PAT withwrite:packagesif publishing from a fork or across orgs. - Example (in the workflow):
- permissions: contents: read packages: write
- Link: Workflow file
2. coderabbit.yml
- Description: Uses the Coderabbit AI PR-reviewer to automatically review pull requests when they’re opened, synchronized or reopened.
- Why: Automates PR review to save time and enforce consistency.
- Executed Flow:
- Detect PR open/sync/reopen event
- Trigger Coderabbit API call
- Post review results as PR comments
- Secrets/Dependencies:
CODERABBIT_API_KEY(if required). - Link: Workflow file
3. docs.yml
- Description: Builds the documentation site with VitePress and deploys it to GitHub Pages on pushes affecting the
docs/**folder or on manual dispatch. - Why: Keeps the documentation site (GitHub Pages) up to date automatically.
- Executed Flow:
- Checkout repository
- Install Node.js + dependencies
- Run VitePress build
- Deploy static site to GitHub Pages
- Link: Workflow file
4. format.yaml
- Description: Runs code formatters (
gofmtfor the API, Prettier for the frontend and a formatting task for the CLI) on pushes tomasterorfeat/developand auto-commits any changes. - Why: Enforces consistent code style across all components.
- Executed Flow:
- Checkout repository
- Run
gofmton API code - Run
prettieron frontend code - Run formatter on CLI
- Auto-commit changes (if any)
- Note: use a commit message containing
[skip ci]and/or guard withif: github.actor != 'github-actions[bot]', plusconcurrency:to avoid commit loops. - Requires
permissions: contents: write.
- Link: Workflow file
5. labeler.yml
- Description: Applies predefined labels to pull requests using
actions/labelerwhen a PR is opened, synchronized or reopened. - Why: Automates PR labeling to simplify triage.
- Executed Flow:
- PR opened/sync/reopen triggers workflow
- Load
.github/labeler.ymlrules - Apply matching labels to PR
- Dependencies:
.github/labeler.ymlconfiguration file. - Permissions:
permissions: pull-requests: write. - Link: Workflow file
6. release-cli.yml
- Description: Builds and packages the CLI component (using Poetry and fpm) into various package formats on pushes or pull requests touching the
clidirectory, and then creates a release artifact. - Why: Produces distributable CLI packages for multiple environments.
- Executed Flow:
- Checkout repository
- Install Python + Poetry
- Build CLI packages (
.deb,.rpm, etc.) withfpm - Upload release artifacts to GitHub Releases
- Artifacts: Release artifacts uploaded to GitHub Releases.
- Secrets/Permissions:
GITHUB_TOKENwithpermissions: contents: write(and any signing keys/envs if packages are signed). - Link: Workflow file
7. release.yml
- Description: Uses changelog action to generate a prerelease tag and create a GitHub pre-release whenever code is pushed to
masteror triggered manually. - Why: Provides prerelease builds for early testing.
- Executed Flow:
- Checkout repository
- Generate changelog
- Create prerelease tag
- Publish GitHub prerelease
- Permissions:
GITHUB_TOKENwithpermissions: contents: write. - Link: Workflow file
8. security.yml
- Description: Performs security scans on a weekly schedule or on pushes to key branches; runs Trivy for dependency vulnerabilities and TruffleHog for secret detection.
- Why: Ensures proactive detection of vulnerabilities and secrets.
- Executed Flow:
- Checkout repository
- Run Trivy scan for dependencies
- Run TruffleHog scan for secrets
- Upload SARIF results to GitHub Code scanning (Security tab)
- Link: Workflow file
9. test.yaml
- Description: Executes Go unit tests on pushes to
masterorfeat/developbranches. - Why: Maintains code correctness and prevents regressions.
- Executed Flow:
- Checkout repository
- Set up Go environment
- Run
go test ./... - Report test results in workflow logs
- Tip: enable module/build cache to reduce CI time.
- Link: Workflow file
🔑 Secrets & Environment Variables
Workflows may rely on:
GITHUB_TOKEN→ default GitHub token with repo access.- For actions that write (releases, labels, packages), set workflow/job
permissions:explicitly (e.g.,contents: write,pull-requests: write,packages: write). - Prefer
GITHUB_TOKENfor registry pushes and labeling (set minimalpermissions). CODERABBIT_API_KEY→ for Coderabbit integration.- Other repository secrets as defined in
Settings > Secrets and variables. Notes: - Avoid Personal Access Tokens unless necessary; scope minimally and rotate regularly.
🛠️ Troubleshooting Workflows
- Check Logs: Review detailed logs under the GitHub Actions tab.
- Rerun: Use the “Re-run jobs” option if a transient error occurs.
- Secrets: Ensure required secrets are set in repository settings.
- Permissions: Verify tokens have the required scopes (e.g.,
package:writefor GHCR). - Workflow permissions: Check
permissions:at workflow/job level (defaults can be read-only). - Concurrency/loops: Ensure auto-commit workflows avoid re-trigger loops (
[skip ci], actor guard,concurrency:).