Skip to content

Docusaurus

Docusaurus #105

Workflow file for this run

name: metadata check
on: [pull_request]
jobs:
metadata-check:
runs-on: ubuntu-latest
env:
PATH_REGEX: ^.+\/docs\/.+\/(ja|en)\/section\-[0-9]\/lesson\-[0-9]_.+\.md$
steps:
- uses: actions/checkout@v4
- name: check lesson count
run: |
for dir in docs/*/ja/
do
CONTENT="$(echo $dir | cut -d'/' -f2)"
MDSECTIONCOUNT=$(jq -c '.total_sections' < public/metadata/$CONTENT/description.json)
FSSECTIONCOUNT=$(find docs/$CONTENT/ja/ -type d -iname "section-*" | wc -l)
if (( $MDSECTIONCOUNT != $FSSECTIONCOUNT ))
then
echo "Update section count to $FSSECTIONCOUNT in public/$CONTENT/description.json (currently $MDSECTIONCOUNT)"
exit 1
fi
MDLESSONCOUNT=$(jq -c '.total_lessons' < public/metadata/$CONTENT/description.json)
FSLESSONCOUNT=$(find docs/$CONTENT/ja/ -type f ! -iname '.*' | wc -l)
if (( $MDLESSONCOUNT != $FSLESSONCOUNT ))
then
echo "Update lesson count to $FSLESSONCOUNT in public/$CONTENT/description.json (currently $MDLESSONCOUNT)"
exit 1
fi
echo "$CONTENT: $FSSECTIONCOUNT sections / $FSLESSONCOUNT lessons"
done