Skip to content

Commit

Permalink
Removed outdated scripts for mkdocs + added check-docs ci
Browse files Browse the repository at this point in the history
  • Loading branch information
phklive committed Mar 5, 2025
1 parent d1861a1 commit 233e1f1
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 10 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Runs docs related jobs.
# CI job heavily inspired by: https://github.com/tarides/changelog-check-action

name: docs

on:
pull_request:
types: [opened, reopened, synchronize, labeled, unlabeled]

jobs:
documented:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Check for changes in the docs directory
env:
BASE_REF: ${{ github.event.pull_request.base.ref }}
NO_DOCS_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'no docs') }}
run: ./scripts/check-docs.sh "${{ inputs.docs }}"
shell: bash
21 changes: 21 additions & 0 deletions scripts/check-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -uo pipefail

DOCS_DIR="docs/"

if [ "${NO_DOCS_LABEL}" = "true" ]; then
# 'no docs' label set, so finish successfully
echo "\"no docs\" label has been set"
exit 0
else
# a docs check is required
# fail if the diff is empty (no changes in docs directory)
if git diff --quiet "origin/${BASE_REF}" -- "${DOCS_DIR}"; then
>&2 echo "Changes should be accompanied by documentation updates in the \"docs/\" directory.
This behavior can be overridden by using the \"no docs\" label, which is used for changes
that don't require documentation updates or are purely maintenance-related."
exit 1
fi

echo "The \"docs/\" directory has been updated."
fi
3 changes: 0 additions & 3 deletions scripts/docs_requirements.txt

This file was deleted.

7 changes: 0 additions & 7 deletions scripts/serve-doc-site.sh

This file was deleted.

0 comments on commit 233e1f1

Please sign in to comment.