Skip to content
Merged
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
80 changes: 80 additions & 0 deletions .github/workflows/docs-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Documentation Quality Check

on:
pull_request:
branches: [gh-pages]
types: [opened, synchronize, reopened, closed]
paths:
- "docs/**"
- ".github/workflows/docs-check.yml"
- "README.md"
- "DEVELOPER.md"
push:
branches: [gh-pages]
paths:
- "docs/**"
- ".github/workflows/docs-check.yml"
- "README.md"
- "DEVELOPER.md"

jobs:
docs-checks:
# Skip checks on closed PRs (only need the notification)
if: github.event_name != 'pull_request' || github.event.action != 'closed'
uses: gardenlinux/docs/.github/workflows/docs-checks.yml@main
with:
override-repo: ${{ github.event.repository.name }}
override-ref: ${{ github.head_ref || github.ref_name }}
override-commit: ${{ github.event.pull_request.head.sha || github.sha }}

notify-docs:
name: Notify docs
needs: [docs-checks]
runs-on: ubuntu-24.04
# Only notify for PR events (not push events which lack PR context)
# Run after checks pass for open PRs, OR immediately for merged PRs
if: |
always() &&
github.event_name == 'pull_request' &&
(
(github.event.action == 'closed' && github.event.pull_request.merged == true) ||
(github.event.action != 'closed' && needs.docs-checks.result == 'success')
)
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
private-key: ${{ secrets.DOCS_BOT_PRIVATE_KEY }}
repositories: docs

- name: Send repository dispatch to docs
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
const isMergedPR = context.payload.action === 'closed' &&
context.payload.pull_request.merged === true;

// For merged PRs, use the base branch (the branch it was merged into)
// For open PRs, use the head branch (feature branch)
const ref = isMergedPR
? context.payload.pull_request.base.ref
: context.payload.pull_request.head.ref;

await github.rest.repos.createDispatchEvent({
owner: 'gardenlinux',
repo: 'docs',
event_type: 'docs-pr',
client_payload: {
repo: '${{ github.event.repository.name }}',
pr_number: `${context.payload.pull_request.number}`,
commit_sha: isMergedPR
? context.payload.pull_request.merge_commit_sha
: context.payload.pull_request.head.sha,
ref: ref,
event: isMergedPR ? 'merged' : 'pr_success'
}
});
core.info('Repository dispatch sent to docs');
Loading