Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/aggregated-repo-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ permissions:
jobs:
detect-changes:
name: Detect docs path changes
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
name: Docs checks gate
needs: [detect-changes, docs-checks]
if: always() && (github.event_name != 'pull_request' || github.event.action != 'closed')
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- name: Evaluate docs checks result
run: |
Expand All @@ -130,7 +130,7 @@ jobs:
notify-docs:
name: Notify docs
needs: [detect-changes, docs-checks]
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
# Only notify for PR events and only when the PR actually touched docs.
# Run after checks pass for open PRs, OR immediately for merged PRs.
if: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-pr-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
validate:
name: Check for non-main refs
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
27 changes: 16 additions & 11 deletions .github/workflows/docs-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ jobs:
aggregate:
# Public fork checks need no private credentials; enterprise checks are trusted-only.
if: github.event_name != 'pull_request_target' && (!inputs.enterprise-host || github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
permissions:
contents: read
env:
POETRY_VIRTUALENVS_CREATE: "false"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -53,7 +55,7 @@ jobs:

- name: Install Python dependencies
run: |
pip install -r requirements.txt
make install-python

- name: Verify aggregation authentication
env:
Expand Down Expand Up @@ -98,7 +100,7 @@ jobs:

linkcheck:
needs: aggregate
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -123,7 +125,7 @@ jobs:
uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # unreleased
with:
lycheeVersion: v0.24.2
args: --cache --max-cache-age 1d docs/**/*.md --config lychee.toml --root-dir "$(pwd)/docs/"
args: --cache --max-cache-age 1d docs/**/*.md --config lychee.toml --root-dir "$(pwd)/docs/" --max-retries 10 --retry-wait-time 10

- name: Save lychee cache
if: always()
Expand All @@ -134,7 +136,9 @@ jobs:

spelling:
needs: aggregate
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
env:
POETRY_VIRTUALENVS_CREATE: "false"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -161,15 +165,14 @@ jobs:

- name: Install dependencies
run: |
pnpm install
pip install -r requirements.txt
make install

- name: Run spelling check
run: make spelling

woke:
needs: aggregate
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -191,7 +194,7 @@ jobs:

- name: Install dependencies
run: |
pnpm install
make install-npm
go install github.com/get-woke/woke@latest

- name: Run inclusive language check
Expand All @@ -201,7 +204,9 @@ jobs:

documentation-quality:
needs: aggregate
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
env:
POETRY_VIRTUALENVS_CREATE: "false"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
Expand All @@ -219,7 +224,7 @@ jobs:
python-version: "3.13"

- name: Install PyYAML
run: pip install pyyaml
run: make install-python

- name: Run Garden Linux Docs Quality
run: python3 src/gldq.py docs/ --strict
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,217 +31,217 @@

jobs:
create-pr:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc # v3.4.0
with:
client-id: ${{ secrets.DOCS_BOT_APP_ID }}
private-key: ${{ secrets.DOCS_BOT_PRIVATE_KEY }}
repositories: docs,${{ github.event.client_payload.repo || inputs.repo }}

- name: Checkout docs
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0

- name: Configure git
run: |
git config user.name "gardenlinux-docs-bot[bot]"
git config user.email "${{ secrets.DOCS_BOT_APP_ID }}+gardenlinux-docs-bot[bot]@users.noreply.github.com"

- name: Extract payload
id: payload
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
let payload;
if (context.eventName === 'workflow_dispatch') {
payload = context.payload.inputs;
} else {
payload = context.payload.client_payload;
}
core.setOutput('repo', payload.repo);
core.setOutput('pr_number', payload.pr_number);
core.setOutput('commit_sha', payload.commit_sha);
core.setOutput('ref', payload.ref);
core.setOutput('event', payload.event);

- name: Create or update branch
run: |
BRANCH="auto/${{ steps.payload.outputs.repo }}/${{ steps.payload.outputs.pr_number }}"
git fetch origin main
git checkout -B "$BRANCH" origin/main

- name: Update repos-config.json
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const fs = require('fs');
const repoName = '${{ steps.payload.outputs.repo }}';
const commitSha = '${{ steps.payload.outputs.commit_sha }}';
const ref = '${{ steps.payload.outputs.ref }}';
const event = '${{ steps.payload.outputs.event }}';

const config = JSON.parse(fs.readFileSync('repos-config.json', 'utf8'));

let found = false;
for (const repo of config.repos) {
if (repo.name === repoName) {
repo.commit = commitSha;
// Always use the ref from the payload (for merged PRs, this is the base branch)
repo.ref = ref;
found = true;
break;
}
}

if (!found) {
core.setFailed(`Repository '${repoName}' not found in repos-config.json. Available repos: ${config.repos.map(r => r.name).join(', ')}`);
return;
}

fs.writeFileSync('repos-config.json', JSON.stringify(config, null, 2) + '\n');
core.info(`Updated ${repoName}: ref=${ref}, commit=${commitSha}`);

- name: Commit and push
run: |
git add repos-config.json
git commit -m "docs(${{ steps.payload.outputs.repo }}): update commit lock to ${{ steps.payload.outputs.commit_sha }}"
git push -f origin "auto/${{ steps.payload.outputs.repo }}/${{ steps.payload.outputs.pr_number }}"

- name: Create or update PR
id: docs_pr
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
const branch = `auto/${{ steps.payload.outputs.repo }}/${{ steps.payload.outputs.pr_number }}`;
const prNumber = '${{ steps.payload.outputs.pr_number }}';
const repo = '${{ steps.payload.outputs.repo }}';
const event = '${{ steps.payload.outputs.event }}';
const commitSha = '${{ steps.payload.outputs.commit_sha }}';

// Check if PR already exists
const { data: existingPRs } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
head: `${context.repo.owner}:${branch}`,
state: 'open'
});

let prUrl;
let docsPrNumber;

if (existingPRs.length > 0) {
const existingPR = existingPRs[0];
core.info(`PR #${existingPR.number} already exists, updating...`);

const isDraft = event !== 'merged';
const statusText = isDraft ? 'Draft (waiting for source PR to merge)' : 'Ready for review';

// Update PR with latest status, draft setting, and body
const updateBody = [
'## Summary',
'',
`Automated PR to update the commit lock for \`${repo}\` repository.`,
'',
`- **Source PR:** https://github.com/gardenlinux/${repo}/pull/${prNumber}`,
`- **Commit:** \`${commitSha}\``,
`- **Status:** ${statusText}`,
'',
'This PR was automatically created by the docs-check workflow.'
].join('\n');

await github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: existingPR.number,
draft: isDraft,
body: updateBody
});

prUrl = existingPR.html_url;
docsPrNumber = existingPR.number;
} else {
core.info('Creating new draft PR...');
const isDraft = event !== 'merged';
const statusText = isDraft ? 'Draft (waiting for source PR to merge)' : 'Ready for review';

const createBody = [
'## Summary',
'',
`Automated PR to update the commit lock for \`${repo}\` repository.`,
'',
`- **Source PR:** https://github.com/gardenlinux/${repo}/pull/${prNumber}`,
`- **Commit:** \`${commitSha}\``,
`- **Status:** ${statusText}`,
'',
'This PR was automatically created by the docs-check workflow.'
].join('\n');

const { data: newPR } = await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
head: branch,
base: 'main',
draft: isDraft,
title: `docs(${repo}): Update commit lock from PR #${prNumber}`,
body: createBody
});
prUrl = newPR.html_url;
docsPrNumber = newPR.number;
}

core.setOutput('pr_url', prUrl);
core.setOutput('docs_pr_number', docsPrNumber);

- name: Comment on source PR
if: steps.payload.outputs.pr_number != ''
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
const prNumber = parseInt('${{ steps.payload.outputs.pr_number }}');
const repo = '${{ steps.payload.outputs.repo }}';
const prUrl = '${{ steps.docs_pr.outputs.pr_url }}';
const docsPrNumber = '${{ steps.docs_pr.outputs.docs_pr_number }}';

const commentBody = `📚 **Documentation Preview PR:** ${prUrl}
😎 **Deploy Preview:** https://deploy-preview-${docsPrNumber}--gardenlinux-docs.netlify.app

A PR has been created/updated to preview the documentation changes from this PR.`;

// Find existing bot comment
const { data: comments } = await github.rest.issues.listComments({
owner: 'gardenlinux',
repo: repo,
issue_number: prNumber
});

const botComment = comments.find(comment =>
comment.body.includes('📚 **Documentation Preview PR:**') &&
comment.user.type === 'Bot'
);

if (botComment) {
// Update existing comment
await github.rest.issues.updateComment({
owner: 'gardenlinux',
repo: repo,
comment_id: botComment.id,
body: commentBody
});
core.info(`Updated existing comment #${botComment.id}`);
} else {
// Create new comment
await github.rest.issues.createComment({
owner: 'gardenlinux',
repo: repo,
issue_number: prNumber,
body: commentBody
});
core.info('Created new comment');
}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
2 changes: 1 addition & 1 deletion .github/workflows/netlify-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:

jobs:
deploy:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- name: Trigger Netlify build hook
run: curl -X POST -d {} https://api.netlify.com/build_hooks/${{ secrets.NETLIFY_BUILD_HOOK }}
2 changes: 1 addition & 1 deletion .github/workflows/tests-skip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
jobs:
pytest:
name: pytest (unit + integration)
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- run: |
echo "No changes under src/, tests/, requirements.txt, or Makefile."
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ on:
jobs:
pytest:
name: pytest (unit + integration)
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
env:
POETRY_VIRTUALENVS_CREATE: "false"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

Expand All @@ -34,7 +36,7 @@ jobs:

- name: Install Python dependencies
run: |
pip install -r requirements.txt
make install-python

- name: Run tests
run: make test
30 changes: 20 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help run build preview publish transform aggregate aggregate-repo aggregate-update-repo aggregate-repo-single aggregate-update-repo-single test-aggregate-local clean clean-projects clean-aggregated-git test test-unit test-integration check spelling linkcheck woke glossary glossary-check docs-check docs-check-strict format check-system-deps
.PHONY: help run build preview publish transform aggregate aggregate-repo aggregate-update-repo aggregate-repo-single aggregate-update-repo-single test-aggregate-local clean clean-projects clean-aggregated-git test test-unit test-integration check spelling linkcheck woke glossary glossary-check docs-check docs-check-strict format check-system-deps check-python-deps check-npm-deps

help:
@echo "Garden Linux Documentation Hub - Available targets:"
Expand Down Expand Up @@ -38,15 +38,25 @@ help:
@echo " clean - Clean aggregated docs and build artifacts"
@echo ""

check-system-deps:
@if ! command -v pnpm >/dev/null 2>&1; then @echo "pnpm not found! Please install using your package manager."; exit 1; fi
@if ! command -v python3 --version >/dev/null 2>&1; then @echo "python3 not installed! Please install using your package manager."; exit 1; fi
@if ! command -v git --version >/dev/null 2>&1; then @echo "git not installed! Please install using you package manager."; exit 1; fi
check-python-deps:
if ! command -v python3 >/dev/null 2>&1; then echo "python3 not installed! Please install using your package manager."; exit 1; fi
if ! command -v git >/dev/null 2>&1; then echo "git not installed! Please install using your package manager."; exit 1; fi

install: check-system-deps
@echo "Installing dependencies..."
check-npm-deps:
if ! command -v pnpm >/dev/null 2>&1; then echo "pnpm not found! Please install using your package manager."; exit 1; fi

check-system-deps: check-python-deps check-npm-deps

install-python: check-python-deps
@echo "Installing python dependencies..."
pip install "poetry>=2"
poetry --no-root install

install-npm: check-npm-deps
@echo "Installing npm dependencies..."
pnpm install
pip install -r requirements.txt

install: install-python install-npm

# Documentation Aggregation
aggregate-local:
Expand Down Expand Up @@ -128,11 +138,11 @@ format:
test: test-unit test-integration
@echo "All tests passed!"

test-unit:
test-unit: install-python
@echo "Running unit tests..."
python3 -m pytest tests/unit/ -v

test-integration:
test-integration: install-python
@echo "Running integration tests..."
python3 -m pytest tests/integration/ -v

Expand Down
14 changes: 7 additions & 7 deletions docs/contributing/documentation/ci-workflows-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ The `docs-checks-gate` job is a dedicated status-check gate that always produces
docs-checks-gate:
needs: [detect-changes, docs-checks]
if: always() && (github.event_name != 'pull_request' || github.event.action != 'closed')
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- name: Evaluate docs checks result
run: |
Expand Down Expand Up @@ -311,10 +311,10 @@ the PR's documentation against the rest of the published site.

| Job | Depends on | Runner | Purpose |
| ----------- | ----------- | -------------- | ------------------------------------------------------------------------ |
| `aggregate` | — | `ubuntu-24.04` | Runs `aggregate.py` with override arguments; uploads `docs/` as artifact |
| `linkcheck` | `aggregate` | `ubuntu-24.04` | Runs lychee link checker on the aggregated `docs/**/*.md` |
| `spelling` | `aggregate` | `ubuntu-24.04` | Runs `make spelling` (codespell) |
| `woke` | `aggregate` | `ubuntu-24.04` | Runs `make woke` (inclusive-language checker) |
| `aggregate` | — | `ubuntu-latest` | Runs `aggregate.py` with override arguments; uploads `docs/` as artifact |
| `linkcheck` | `aggregate` | `ubuntu-latest` | Runs lychee link checker on the aggregated `docs/**/*.md` |
| `spelling` | `aggregate` | `ubuntu-latest` | Runs `make spelling` (codespell) |
| `woke` | `aggregate` | `ubuntu-latest` | Runs `make woke` (inclusive-language checker) |

### Artifacts

Expand Down Expand Up @@ -422,7 +422,7 @@ The `client_payload` (or `inputs` for manual dispatch) must contain:

| Job | Runner | Purpose |
| ----------- | -------------- | --------------------------------------------------------------------------------------------------------- |
| `create-pr` | `ubuntu-24.04` | Creates/updates a branch, modifies `repos-config.json`, opens/updates a PR, and comments on the source PR |
| `create-pr` | `ubuntu-latest` | Creates/updates a branch, modifies `repos-config.json`, opens/updates a PR, and comments on the source PR |

### Job Steps (in order)

Expand Down Expand Up @@ -538,7 +538,7 @@ check fails, blocking the merge.

| Job | Runner | Purpose |
| ---------- | -------------- | -------------------------------------------------------------------------- |
| `validate` | `ubuntu-24.04` | Reads `repos-config.json`, iterates over repos, validates each `ref` field |
| `validate` | `ubuntu-latest` | Reads `repos-config.json`, iterates over repos, validates each `ref` field |

### Required Secrets / Permissions

Expand Down
3 changes: 2 additions & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[build]
command = "pnpm install && pip install -r requirements.txt && make publish"
command = "make install publish"
publish = "docs/.vitepress/dist"

[build.environment]
NODE_VERSION = "22"
PYTHON_VERSION = "3.13"
POETRY_VIRTUALENVS_CREATE = "false"

# Proxy Plausible event endpoint through our own domain to avoid adblockers.
# https://plausible.io/docs/proxy/guides/netlify
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"@floating-ui/vue": "^2.0.1",
"@plausible-analytics/tracker": "0.4.6",
"autoprefixer": "10.4.0",
"corepack": "^0.34.6",
"corepack": "^0.34.7",
"gray-matter": "4.0.3",
"js-yaml": "4.3.2",
"lodash-es": "4.18.1",
"vitepress": "1.6.3",
"vitepress-mermaid-renderer": "^1.1.20",
"vitepress-sidebar": "1.31.1",
"vitepress-mermaid-renderer": "^1.2.3",
"vitepress-sidebar": "1.41.0",
"vue": "3.5.16"
},
"devDependencies": {
Expand Down
Loading
Loading