docs: 📝 在Alphine Linux文档相应增加安装镜像部分。 #215
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint | |
| on: | |
| pull_request: | |
| paths: | |
| - '**/*.md' | |
| jobs: | |
| markdownlint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get changed files | |
| id: changed-files | |
| uses: tj-actions/changed-files@v45 | |
| with: | |
| files: '**/*.md' | |
| - name: Lint Markdown files | |
| uses: DavidAnson/markdownlint-cli2-action@v20 | |
| if: steps.changed-files.outputs.any_changed == 'true' | |
| with: | |
| globs: ${{ steps.changed-files.outputs.all_changed_files }} | |
| separator: "," | |
| config: .markdownlint.json | |
| zhlint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install zhlint | |
| run: yarn global add zhlint | |
| - name: Get changed files | |
| id: changed-files | |
| uses: tj-actions/changed-files@v45 | |
| with: | |
| files: '**/*.md' | |
| - name: Lint Markdown files | |
| env: | |
| ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | |
| run: | | |
| mkdir -p linted_output | |
| file_list="linted_output/file_list.txt" | |
| linted_failed=0 | |
| for file in ${{ env.ALL_CHANGED_FILES }}; do | |
| set +e | |
| zhlint --config "$GITHUB_WORKSPACE"/ci/.zhlintrc "$file" | |
| if [ $? -ne 0 ]; then | |
| linted_failed=1 | |
| echo "$file" >> "$file_list" | |
| output_file="linted_output/report_and_suggested_fixes/$file" | |
| mkdir -p "$(dirname "$output_file")" | |
| zhlint --config "$GITHUB_WORKSPACE"/ci/.zhlintrc "$file" --output="$output_file" > "$output_file.log" 2>&1 | |
| fi | |
| set -e | |
| done | |
| echo "linted_failed=$linted_failed" >> "$GITHUB_ENV" | |
| - name: Upload Linted Markdown | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linted-markdown | |
| path: linted_output/ | |
| - name: Check lint errors | |
| run: | | |
| set -e | |
| if [ "${{ env.linted_failed }}" -ne 0 ]; then | |
| echo "Linting errors found. Please check the reports and suggested fixes in uploaded artifact." | |
| cat "$output_file" | |
| exit 1 | |
| fi |