diff --git a/.github/file-filters.yml b/.github/file-filters.yml index eb0791ffa..7dd58c68f 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -11,3 +11,6 @@ webapp: &webapp - '.github/workflows/test-webapp.yml' - 'webapp/**/*' - 'package.json' + +markdown-files: &markdown-files + - '**/*.md' diff --git a/.github/workflows/check-documentation.yml b/.github/workflows/check-documentation.yml new file mode 100644 index 000000000..d374f41e8 --- /dev/null +++ b/.github/workflows/check-documentation.yml @@ -0,0 +1,40 @@ +name: ocelot.social check documentation + +on: push + +jobs: + files-changed: + name: Detect File Changes - Markdown files + runs-on: ubuntu-latest + outputs: + markdown-files: ${{ steps.changes.outputs.markdown-files }} + steps: + - name: Checkout code + uses: actions/checkout@master + + - name: Check for markdown file changes + uses: dorny/paths-filter@v2.11.1 + id: changes + with: + token: ${{ github.token }} + filters: .github/file-filters.yml + list-files: shell + + check-markdown-links: + name: Check Markdown links + if: needs.files-changed.outputs.markdown-files == 'true' + needs: files-changed + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@master + - name: Check Markdown Links + uses: gaurav-nelson/github-action-markdown-link-check@master + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'no' + # at any .md file change take the chance to check the links in all .md files + check-modified-files-only: 'no' + config-file: '.github/workflows/mlc_config.json' + base-branch: 'master' + folder-path: '.' diff --git a/.github/workflows/mlc_config.json b/.github/workflows/mlc_config.json new file mode 100644 index 000000000..dd9c81f3c --- /dev/null +++ b/.github/workflows/mlc_config.json @@ -0,0 +1,12 @@ +{ + "timeout": "20s", + "retryOn429": true, + "retryCount": 2, + "fallbackRetryDelay": "30s", + "aliveStatusCodes": [200, 206], + "ignorePatterns": [ + { + "pattern": "^(https:\/\/github.com\/Ocelot-Social-Community\/Ocelot-Social\/pull\/|http:\/\/localhost)" + } + ] +}