Skip to content

Fix: Re-add accidentially deleted CLI document #16

Fix: Re-add accidentially deleted CLI document

Fix: Re-add accidentially deleted CLI document #16

Workflow file for this run

name: Documentation Quality Check
on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened, closed]
paths:
- 'docs/**'
push:
branches: [main]
paths:
- 'docs/**'
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');