yuluo-yx commented on code in PR #2608:
URL: https://github.com/apache/hertzbeat/pull/2608#discussion_r1731343899
##########
.github/workflows/doc-build-test.yml:
##########
@@ -28,103 +28,43 @@ on:
- 'home/**'
jobs:
- build:
+ docs-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
+ - uses: actions/setup-python@v4
+ with:
+ python-version: '3.8'
+
- name: Check Markdown
uses: DavidAnson/markdownlint-cli2-action@v16
with:
globs: './home/**/*.md'
- - name: Check filename in home/blog
- run: |
- TARGET_DIR="./home/blog"
- invalid_files=()
- while IFS= read -r -d '' file; do
- filename=$(basename "$file")
- if [[ ! "$filename" =~ ^[_a-z0-9-]+(\.[_a-z0-9-]+)*$ ]]; then
- invalid_files+=("$file")
- fi
- done < <(find "$TARGET_DIR" -type f -print0)
- if [ ${#invalid_files[@]} -ne 0 ]; then
- echo "Error: The following files have invalid names:(File name
should only contain lowercase letters, numbers, and hyphens.)"
- for invalid_file in "${invalid_files[@]}"; do
- echo "$invalid_file"
- done
- exit 1
- else
- echo "All file names are valid."
- fi
- - name: Check filename in home/docs
- run: |
- TARGET_DIR="./home/docs"
- invalid_files=()
- while IFS= read -r -d '' file; do
- filename=$(basename "$file")
- if [[ ! "$filename" =~ ^[_a-z0-9-]+(\.[_a-z0-9-]+)*$ ]]; then
- invalid_files+=("$file")
- fi
- done < <(find "$TARGET_DIR" -type f -print0)
- if [ ${#invalid_files[@]} -ne 0 ]; then
- echo "Error: The following files have invalid names:(File name
should only contain lowercase letters, numbers, and hyphens.)"
- for invalid_file in "${invalid_files[@]}"; do
- echo "$invalid_file"
- done
- exit 1
- else
- echo "All file names are valid."
- fi
- - name: Check filename in /zh-cn/docusaurus-plugin-content-blog
- run: |
- TARGET_DIR="./home/i18n/zh-cn/docusaurus-plugin-content-blog"
- invalid_files=()
- while IFS= read -r -d '' file; do
- filename=$(basename "$file")
- if [[ ! "$filename" =~ ^[_a-z0-9-]+(\.[_a-z0-9-]+)*$ ]]; then
- invalid_files+=("$file")
- fi
- done < <(find "$TARGET_DIR" -type f -print0)
- if [ ${#invalid_files[@]} -ne 0 ]; then
- echo "Error: The following files have invalid names:(File name
should only contain lowercase letters, numbers, and hyphens.)"
- for invalid_file in "${invalid_files[@]}"; do
- echo "$invalid_file"
- done
- exit 1
- else
- echo "All file names are valid."
- fi
- - name: Check filename in
/home/i18n/zh-cn/docusaurus-plugin-content-docs/current
- run: |
- TARGET_DIR="./home/i18n/zh-cn/docusaurus-plugin-content-docs/current"
- invalid_files=()
- while IFS= read -r -d '' file; do
- filename=$(basename "$file")
- if [[ ! "$filename" =~ ^[_a-z0-9-]+(\.[_a-z0-9-]+)*$ ]]; then
- invalid_files+=("$file")
- fi
- done < <(find "$TARGET_DIR" -type f -print0)
- if [ ${#invalid_files[@]} -ne 0 ]; then
- echo "Error: The following files have invalid names:(File name
should only contain lowercase letters, numbers, and hyphens.)"
- for invalid_file in "${invalid_files[@]}"; do
- echo "$invalid_file"
- done
- exit 1
- else
- echo "All file names are valid."
- fi
- - name: Dead Link
+
+ - name: Check filenames
+ run: python ./script/ci/docs/check_file_name.py
./script/ci/docs/check_file_name.json
+
+ - name: Dead Link Check
run: |
sudo npm install -g [email protected]
for file in $(find ./home -name "*.md"); do
- if ! grep -Fxq "$file" .github/exclude_files.txt; then
- markdown-link-check -c .github/link_check.json -q "$file"
+ if ! grep -Fxq "$file" ./script/ci/exclude_files.txt; then
+ markdown-link-check -c ./script/ci/link_check.json -q "$file"
fi
done
+ # uses: JustinBeckwith/linkinator-action@v6
Review Comment:
done!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]