fix #151
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: Markdown lint | |
| on: | |
| workflow_call: | |
| inputs: | |
| md-link-config-file-path: | |
| required: false | |
| type: string | |
| md-lint-config-file-path: | |
| required: false | |
| type: string | |
| push: | |
| jobs: | |
| markdown-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Checkout default configs | |
| if: inputs.md-link-config-file-path == '' || inputs.md-lint-config-file-path == '' | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: clubcedille/cedille-workflows | |
| path: cedille-workflows | |
| ref: master | |
| sparse-checkout: | | |
| .markdownlint.json | |
| .mlc_config.json | |
| sparse-checkout-cone-mode: false | |
| - name: Determine markdown link config file | |
| id: linkconfig | |
| run: | | |
| if [ -z "${{ inputs.md-link-config-file-path }}" ]; then | |
| echo "::set-output name=link_config_path::cedille-workflows/.mlc_config.json" | |
| else | |
| echo "::set-output name=link_config_path::${{ inputs.md-link-config-file-path }}" | |
| fi | |
| - name: Determine markdown lint config file | |
| id: lintconfig | |
| run: | | |
| if [ -z "${{ inputs.md-lint-config-file-path }}" ]; then | |
| echo "::set-output name=lint_config_path::cedille-workflows/.markdownlint.json" | |
| else | |
| echo "::set-output name=lint_config_path::${{ inputs.md-lint-config-file-path }}" | |
| fi | |
| - name: Run markdown lint | |
| uses: DavidAnson/markdownlint-cli2-action@v20 | |
| if: always() | |
| with: | |
| globs: '**/*.md' | |
| config: ${{ github.workspace }}/${{ steps.lintconfig.outputs.lint_config_path }} | |
| - name: Validating links | |
| uses: gaurav-nelson/github-action-markdown-link-check@v1 | |
| with: | |
| use-quiet-mode: true | |
| config-file: ${{ steps.linkconfig.outputs.link_config_path }} |