Skip to content

Documentation CI Workflows Reference

1. docs-check.yml — Per-Repo Caller Workflow

File.github/workflows/docs-check.yml
Lives inEach aggregated repository
TypeCaller workflow — invokes the reusable docs-checks.yml from docs-ng

Triggers

yaml
on:
  pull_request:
    branches: [main, docs-ng]
    types: [opened, synchronize, reopened, closed]
    paths:
      - 'docs/**'
      - 'features/*/README.md'
      - 'features/*/info.yaml'
      - 'flavors.yaml'
      - 'CONTRIBUTING.md'
      - 'SECURITY.md'
  push:
    branches: [main, docs-ng]
    paths:
      # (same path list as above)

The workflow reacts to both PR events and pushes on documentation-relevant paths. The closed PR type is intentionally included so the notification job can detect merged PRs.

Jobs

JobConditionPurpose
docs-checksSkipped when action == 'closed'Calls the reusable quality-check workflow in docs-ng with override inputs
notify-docs-ngRuns after docs-checks succeeds or when a PR is merged (always-conditional)Generates a GitHub App token and sends a repository_dispatch to docs-ng

Inputs Passed to Reusable Workflow

InputValue
override-repoHard-coded repository name (e.g., gardenlinux)
override-refgithub.head_ref (PR branch) or github.ref_name (push)
override-commitpull_request.head.sha or github.sha

Dispatch Payload Sent to docs-ng

json
{
  "repo": "<repo-name>",
  "pr_number": "<PR number>",
  "commit_sha": "<head SHA or merge commit SHA>",
  "ref": "<head branch (open PR) or base branch (merged PR)>",
  "event": "pr_success | merged"
}

Required Secrets

SecretPurpose
DOCS_BOT_APP_IDGitHub App identifier for gardenlinux-docs-bot
DOCS_BOT_PRIVATE_KEYPrivate key used to sign the JWT for App token generation

Outputs / Side-Effects

  • On open/synchronize PR: calls reusable workflow → on success dispatches docs-pr event to docs-ng.
  • On merged PR: skips quality checks, dispatches docs-pr event with event: merged and ref set to the base branch.

Job Graph

mermaid
flowchart TD
    A["PR event on docs paths"] --> B{action == closed?}
    B -->|no| C["docs-checks job<br/>(calls docs-checks.yml @ docs-ng)"]
    C -->|success| D["notify-docs-ng job"]
    B -->|yes, merged| D
    B -->|yes, not merged| E["workflow ends<br/>(no action)"]
    D --> F["repository_dispatch → docs-ng<br/>event_type: docs-pr"]

Common Failure Causes

SymptomLikely cause
docs-checks job failsBroken links, spelling errors, or woke violations in the documentation change
notify-docs-ng job failsDOCS_BOT_APP_ID or DOCS_BOT_PRIVATE_KEY secret missing/invalid; App not installed on docs-ng
Workflow not triggeredChanged files do not match the paths: filter

2. docs-checks.yml — Reusable Quality Checks Workflow

File.github/workflows/docs-checks.yml
Lives ingardenlinux/docs-ng
TypeReusable workflow (workflow_call) + own PR/push trigger

Triggers

yaml
on:
  workflow_call:
    inputs:
      override-repo:
        description: 'Repository name to override (e.g., gardenlinux)'
        required: false
        type: string
      override-ref:
        description: 'Git ref to use for the overridden repo'
        required: false
        type: string
      override-commit:
        description: 'Git commit SHA to use for the overridden repo'
        required: false
        type: string
  pull_request:
    branches: [main]
  push:
    branches: [main]

When called via workflow_call, it validates external repo documentation. When triggered directly by PR/push in docs-ng, it validates the aggregator's own documentation (with no overrides — all repos use their pinned commits).

Inputs

InputRequiredDescription
override-reponoRepository name in repos-config.json to override
override-refnoGit ref (branch) to check out for the overridden repo
override-commitnoExact commit SHA to aggregate from

When all three inputs are provided, aggregate.py substitutes the pinned commit in repos-config.json with the specified commit, effectively testing the PR's documentation against the rest of the published site.

Jobs

JobDepends onRunnerPurpose
aggregateubuntu-24.04Runs aggregate.py with override arguments; uploads docs/ as artifact
linkcheckaggregateubuntu-24.04Runs lychee link checker on the aggregated docs/**/*.md
spellingaggregateubuntu-24.04Runs make spelling (codespell)
wokeaggregateubuntu-24.04Runs make woke (inclusive-language checker)

Artifacts

ArtifactContentsRetention
aggregated-docsFull docs/ directory after aggregation1 day

The artifact is consumed by the three parallel lint jobs (linkcheck, spelling, woke) to avoid re-running aggregation.

Required Permissions

No secrets are required by this workflow itself (it only reads public repositories). When called as a reusable workflow, it inherits the caller's GITHUB_TOKEN permissions (read-only is sufficient).

Job Graph

mermaid
flowchart TD
    A["workflow_call / PR / push"] --> B["aggregate job<br/>aggregate.py --repo X --override-ref Y --override-commit Z"]
    B --> C["Upload artifact:<br/>aggregated-docs"]
    C --> D["linkcheck job<br/>(lychee)"]
    C --> E["spelling job<br/>(make spelling / codespell)"]
    C --> F["woke job<br/>(make woke)"]
    D & E & F --> G["All checks pass ✓"]

Common Failure Causes

SymptomLikely cause
aggregate job failsInvalid repos-config.json entry for the overridden repo; commit SHA not reachable; Python dependency issue
linkcheck job failsBroken internal or external links in Markdown files; check lychee output for specific URLs
spelling job failsUnknown words — add them to the project's codespell dictionary (.codespell/project-words.txt)
woke job failsNon-inclusive language detected — see the woke rule file (.woke.yml) for alternatives

3. docs-pr.yml — Automated Docs PR Workflow

File.github/workflows/docs-pr.yml
Lives ingardenlinux/docs-ng
Typerepository_dispatch consumer + workflow_dispatch (manual)

Triggers

yaml
on:
  repository_dispatch:
    types: [docs-pr]
  workflow_dispatch:
    inputs:
      repo:        # required, string
      pr_number:   # required, string
      commit_sha:  # required, string
      ref:         # required, string
      event:       # required, choice: [pr_success, merged]

The workflow is normally triggered by repository_dispatch from a source repo's docs-check.yml. It can also be triggered manually via workflow_dispatch for debugging or re-running a failed automation.

Dispatch Payload Schema

The client_payload (or inputs for manual dispatch) must contain:

FieldTypeDescription
repostringRepository name as it appears in repos-config.json (e.g., gardenlinux)
pr_numberstringPR number in the source repository
commit_shastringCommit SHA to pin in repos-config.json
refstringBranch name — feature branch for open PRs, base branch (e.g., main) for merged PRs
eventstringEither pr_success (PR is open, checks passed) or merged (PR was merged)

Jobs

JobRunnerPurpose
create-prubuntu-24.04Creates/updates a branch, modifies repos-config.json, opens/updates a PR, and comments on the source PR

Job Steps (in order)

  1. Generate GitHub App token — creates a token with write access to docs-ng and the source repository.
  2. Checkout docs-ng — full fetch depth for branch operations.
  3. Configure git — sets bot identity for commits.
  4. Extract payload — normalizes repository_dispatch and workflow_dispatch inputs into step outputs.
  5. Create or update branch — creates branch auto/<repo>/<pr_number> from origin/main.
  6. Update repos-config.json — sets commit and ref for the matching repo entry.
  7. Commit and push — force-pushes the branch (always rebased on latest main).
  8. Create or update PR — opens a draft PR (for pr_success) or marks an existing PR as ready-for-review (for merged).
  9. Comment on source PR — posts or updates a comment with the docs-ng PR link and Netlify deploy preview URL.

Required Secrets

SecretPurpose
DOCS_BOT_APP_IDGitHub App identifier (configured at org level in docs-ng)
DOCS_BOT_PRIVATE_KEYPrivate key for JWT token generation

Outputs / Side-Effects

Side-effectDetails
Branch auto/<repo>/<pr_number>Created or force-updated in docs-ng
Draft PR in docs-ngTitle: docs(<repo>): Update commit lock from PR #<N>
PR transitioned to ready-for-reviewWhen event == merged
Comment on source PRContains docs-ng PR URL and Netlify preview link

Branch Naming Convention

All automated branches follow the pattern:

auto/<repo-name>/<pr-number>

Examples: auto/gardenlinux/4521, auto/builder/87.

Job Graph

mermaid
flowchart TD
    A["repository_dispatch<br/>event_type: docs-pr"] --> B["Generate GitHub App token"]
    B --> C["Checkout docs-ng<br/>(full history)"]
    C --> D["Extract payload fields"]
    D --> E["Create/update branch<br/>auto/<repo>/<pr_number>"]
    E --> F["Update repos-config.json<br/>(commit + ref)"]
    F --> G["git commit + push -f"]
    G --> H{PR exists?}
    H -->|yes| I["Update existing PR<br/>(draft status based on event)"]
    H -->|no| J["Create new draft PR"]
    I & J --> K["Post/update comment<br/>on source-repo PR"]

Common Failure Causes

SymptomLikely cause
Job fails at "Generate GitHub App token"DOCS_BOT_APP_ID or DOCS_BOT_PRIVATE_KEY not set in docs-ng repository secrets
"Repository not found in repos-config.json"The dispatching repo's name does not match any name field in repos-config.json
Force-push failsBranch protection rules on docs-ng blocking the bot (auto branches should not be protected)
Comment not postedApp token lacks write access to the source repo's issues/PRs

4. check-pr-main.ymlrepos-config.json Validator

File.github/workflows/check-pr-main.yml
Lives ingardenlinux/docs-ng
TypePR validator (status check)

Triggers

yaml
on:
  pull_request:
    branches: [main]

Runs on every PR targeting main in docs-ng. There is no path filter — it always runs because repos-config.json could be modified in any PR.

Purpose

Prevents merging a PR that contains non-production references in repos-config.json. This ensures that once a docs-ng PR is merged, the site builds against stable refs only.

Validation Rules

The workflow checks every entry in repos-config.json.repos[] and fails if any ref value is not one of:

  • main
  • docs-ng
  • A semantic version string matching ^\d+\.\d+\.\d+$

If a ref points to a feature branch (e.g., feature/my-docs-change), the check fails, blocking the merge.

Jobs

JobRunnerPurpose
validateubuntu-24.04Reads repos-config.json, iterates over repos, validates each ref field

Required Secrets / Permissions

None. The workflow only reads the repository contents using the default GITHUB_TOKEN.

Outputs / Side-Effects

  • Pass: PR can proceed to merge; status check reports "All repos reference main branches or release versions".
  • Fail: PR is blocked; the error message lists which repos have non-compliant refs.

Job Graph

mermaid
flowchart TD
    A["PR opened/updated<br/>targeting main"] --> B["Checkout PR branch"]
    B --> C["Read repos-config.json"]
    C --> D{"For each repo:<br/>ref ∈ {main, docs-ng, semver}?"}
    D -->|all valid| E["✓ Check passes"]
    D -->|invalid refs found| F["✗ Check fails<br/>lists non-compliant repos"]

Common Failure Causes

SymptomLikely cause
Check fails with "non-main branch references"The automated PR was created from an open (not yet merged) source PR — the ref still points at the feature branch
Check fails after source PR was mergedRace condition — the docs-pr.yml workflow has not yet run to update the ref. Wait for the "merged" dispatch to complete and force-push the updated branch
False positive on docs-ng refThe docs-ng ref is in the allowed set — if validation fails, check the exact spelling in repos-config.json