From eaa1917d1e0352c793792e95e64677267f5d17f7 Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Tue, 31 Oct 2023 10:54:38 +0100 Subject: [PATCH 1/2] Add github action for links checker for markdown files --- .github/workflows/lint-markdown-links-pr.yml | 22 ++++++++++++++++++++ .mlc.config.json | 12 +++++++++++ 2 files changed, 34 insertions(+) create mode 100644 .github/workflows/lint-markdown-links-pr.yml create mode 100644 .mlc.config.json diff --git a/.github/workflows/lint-markdown-links-pr.yml b/.github/workflows/lint-markdown-links-pr.yml new file mode 100644 index 00000000..a399ae74 --- /dev/null +++ b/.github/workflows/lint-markdown-links-pr.yml @@ -0,0 +1,22 @@ +name: Lint Markdown Links PR +run-name: ${{github.event.pull_request.title}} +on: [ pull_request ] +jobs: + markdown-link-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Hello world + run: | + echo "Hello world!" + +# - uses: gaurav-nelson/github-action-markdown-link-check@v1 +# with: +# use-quiet-mode: 'yes' +# use-verbose-mode: 'yes' +# config-file: '.mlc.config.json' +# folder-path: '.' +# max-depth: -1 +# check-modified-files-only: 'yes' +# base-branch: ${{ github.base_ref }} diff --git a/.mlc.config.json b/.mlc.config.json new file mode 100644 index 00000000..1c8fb02f --- /dev/null +++ b/.mlc.config.json @@ -0,0 +1,12 @@ +{ + "replacementPatterns": [ + { + "_comment": "a replacement rule for all the in-repository references", + "pattern": "^/", + "replacement": "{{BASEURL}}/" + } + ], + "timeout": "20s", + "retryCount": 5, + "fallbackRetryDelay": "30s" +} From 1bba1f820fb3292424347447ff2089cd32b4e51d Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Tue, 31 Oct 2023 10:56:31 +0100 Subject: [PATCH 2/2] updated action.yaml --- .github/workflows/lint-markdown-links-pr.yml | 22 ++++++++------------ 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/lint-markdown-links-pr.yml b/.github/workflows/lint-markdown-links-pr.yml index a399ae74..85bc4801 100644 --- a/.github/workflows/lint-markdown-links-pr.yml +++ b/.github/workflows/lint-markdown-links-pr.yml @@ -7,16 +7,12 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Hello world - run: | - echo "Hello world!" - -# - uses: gaurav-nelson/github-action-markdown-link-check@v1 -# with: -# use-quiet-mode: 'yes' -# use-verbose-mode: 'yes' -# config-file: '.mlc.config.json' -# folder-path: '.' -# max-depth: -1 -# check-modified-files-only: 'yes' -# base-branch: ${{ github.base_ref }} + - uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' + config-file: '.mlc.config.json' + folder-path: '.' + max-depth: -1 + check-modified-files-only: 'yes' + base-branch: ${{ github.base_ref }}