2023-01-02 20:51:48 +08:00
|
|
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
2022-09-21 05:30:02 +08:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: curl
|
|
|
|
|
|
|
|
name: spell
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2023-12-06 18:05:20 +08:00
|
|
|
- master
|
2022-09-21 05:30:02 +08:00
|
|
|
paths:
|
2023-12-06 18:05:20 +08:00
|
|
|
- '**.md'
|
|
|
|
- '**.3'
|
|
|
|
- '**.1'
|
|
|
|
- '**/spellcheck.yml'
|
|
|
|
- '**/spellcheck.yaml'
|
|
|
|
- '**/wordlist.txt'
|
2022-09-21 05:30:02 +08:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2023-12-06 18:05:20 +08:00
|
|
|
- master
|
2022-09-21 05:30:02 +08:00
|
|
|
paths:
|
2023-12-06 18:05:20 +08:00
|
|
|
- '**.md'
|
|
|
|
- '**.3'
|
|
|
|
- '**.1'
|
|
|
|
- '**/spellcheck.yml'
|
|
|
|
- '**/spellcheck.yaml'
|
|
|
|
- '**/wordlist.txt'
|
2022-09-21 05:30:02 +08:00
|
|
|
|
2022-11-16 22:55:33 +08:00
|
|
|
permissions: {}
|
|
|
|
|
2022-09-21 05:30:02 +08:00
|
|
|
jobs:
|
|
|
|
check:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-12-06 18:05:20 +08:00
|
|
|
- uses: actions/checkout@v4
|
2022-09-21 05:30:02 +08:00
|
|
|
|
2023-12-06 18:05:20 +08:00
|
|
|
- name: install pandoc
|
|
|
|
run: sudo apt-get install pandoc
|
2022-09-21 05:30:02 +08:00
|
|
|
|
2023-12-06 18:05:20 +08:00
|
|
|
- name: build curl.1
|
|
|
|
run: |
|
|
|
|
autoreconf -fi
|
2024-01-09 18:09:30 +08:00
|
|
|
./configure --without-ssl --without-libpsl
|
2023-12-06 18:05:20 +08:00
|
|
|
make -C docs
|
2023-08-01 20:11:50 +08:00
|
|
|
|
2023-12-06 18:05:20 +08:00
|
|
|
- name: strip "uncheckable" sections from .3 pages
|
|
|
|
run: find docs -name "*.3" -size +40c | sed 's/\.3//' | xargs -t -n1 -I OO ./.github/scripts/cleanspell.pl OO.3 OO.33
|
2022-09-21 05:30:02 +08:00
|
|
|
|
2023-12-06 18:05:20 +08:00
|
|
|
- name: convert .3 man pages to markdown
|
|
|
|
run: find docs -name "*.33" -size +40c | sed 's/\.33//' | xargs -t -n1 -I OO pandoc -f man -t markdown OO.33 -o OO.md
|
2022-09-21 05:30:02 +08:00
|
|
|
|
2023-12-06 18:05:20 +08:00
|
|
|
- name: convert .1 man pages to markdown
|
|
|
|
run: find docs -name "*.1" -size +40c | sed 's/\.1//' | xargs -t -n1 -I OO pandoc OO.1 -o OO.md
|
2022-09-21 05:30:02 +08:00
|
|
|
|
2023-12-06 18:05:20 +08:00
|
|
|
- name: trim the curl.1 markdown file
|
|
|
|
run: |
|
|
|
|
perl -pi -e 's/^ .*//' docs/curl.md
|
|
|
|
perl -pi -e 's/\-\-[\a-z0-9-]*//ig' docs/curl.md
|
|
|
|
perl -pi -e 's!https://[a-z0-9%/.-]*!!ig' docs/curl.md
|
2023-08-01 20:11:50 +08:00
|
|
|
|
2023-12-06 18:05:20 +08:00
|
|
|
- name: setup the custom wordlist
|
|
|
|
run: grep -v '^#' .github/scripts/spellcheck.words > wordlist.txt
|
2022-09-21 05:30:02 +08:00
|
|
|
|
2023-12-06 18:05:20 +08:00
|
|
|
- name: Check Spelling
|
|
|
|
uses: rojopolis/spellcheck-github-actions@v0
|
|
|
|
with:
|
|
|
|
config_path: .github/scripts/spellcheck.yaml
|