├── .editorconfig ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── labels.json ├── renovate.json └── workflows │ ├── depup.yml │ ├── labels.yml │ ├── release.yml │ ├── reviewdog.yml │ ├── test.yml │ └── update-linkspector-version.yml ├── .gitignore ├── LICENSE ├── README.md ├── action.yml ├── script.sh └── testdata ├── subdir └── text.md └── text.md /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.sh] 2 | indent_size = 2 3 | indent_style = space 4 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | 2 | liberapay: gaurav-nelson 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 16 | **Expected behavior** 17 | A clear and concise description of what you expected to happen. 18 | 19 | **Screenshots** 20 | If applicable, add screenshots to help explain your problem. 21 | 22 | **Additional context** 23 | Add any other context about the problem here. 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/labels.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "bump:major", 4 | "color": "ef6bb4", 5 | "description": "Attach to PR to automatically bump major version on merge" 6 | }, 7 | { 8 | "name": "bump:minor", 9 | "color": "ef6bb4", 10 | "description": "Attach to PR to automatically bump minor version on merge" 11 | }, 12 | { 13 | "name": "bump:patch", 14 | "color": "ef6bb4", 15 | "description": "Attach to PR to automatically bump patch version on merge" 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base" 4 | ], 5 | "labels": [ 6 | "bump:patch" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /.github/workflows/depup.yml: -------------------------------------------------------------------------------- 1 | name: depup 2 | on: 3 | schedule: 4 | - cron: "14 14 * * *" # Runs at 14:14 UTC every day 5 | repository_dispatch: 6 | types: [depup] 7 | workflow_dispatch: 8 | 9 | jobs: 10 | reviewdog: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v4 14 | - uses: reviewdog/action-depup/with-pr@v1 15 | with: 16 | file: action.yml 17 | version_name: reviewdog_version 18 | repo: reviewdog/reviewdog 19 | labels: "bump:minor" 20 | -------------------------------------------------------------------------------- /.github/workflows/labels.yml: -------------------------------------------------------------------------------- 1 | name: labels 2 | on: 3 | push: 4 | paths: 5 | - .github/labels.json 6 | - .github/workflows/labels.yml 7 | branches: 8 | - main 9 | workflow_dispatch: 10 | jobs: 11 | label: 12 | name: Manage GitHub labels 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v4 17 | - name: Manage labels 18 | uses: lannonbr/issue-label-manager-action@4.0.0 19 | env: 20 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 21 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | on: 3 | push: 4 | branches: 5 | - main 6 | tags: 7 | - "v*.*.*" 8 | pull_request: 9 | types: 10 | - labeled 11 | 12 | jobs: 13 | release: 14 | if: github.event.action != 'labeled' 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@v4 18 | 19 | # Bump version on merging Pull Requests with specific labels. 20 | # (bump:major,bump:minor,bump:patch) 21 | - id: bumpr 22 | if: "!startsWith(github.ref, 'refs/tags/')" 23 | uses: haya14busa/action-bumpr@v1 24 | 25 | # Update corresponding major and minor tag. 26 | # e.g. Update v1 and v1.2 when releasing v1.2.3 27 | - uses: haya14busa/action-update-semver@v1 28 | if: "!steps.bumpr.outputs.skip" 29 | with: 30 | tag: ${{ steps.bumpr.outputs.next_version }} 31 | 32 | # Get tag name. 33 | - id: tag 34 | uses: haya14busa/action-cond@v1 35 | with: 36 | cond: "${{ startsWith(github.ref, 'refs/tags/') }}" 37 | if_true: ${{ github.ref }} 38 | if_false: ${{ steps.bumpr.outputs.next_version }} 39 | 40 | # Create release 41 | - if: "steps.tag.outputs.value != ''" 42 | env: 43 | TAG_NAME: ${{ steps.tag.outputs.value }} 44 | BODY: ${{ steps.bumpr.outputs.message }} 45 | # This token is provided by Actions, you do not need to create your own token 46 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 47 | run: | 48 | gh release create "${TAG_NAME}" -t "Release ${TAG_NAME}" --notes "${BODY}" 49 | 50 | release-check: 51 | if: github.event.action == 'labeled' 52 | runs-on: ubuntu-latest 53 | steps: 54 | - uses: actions/checkout@v4 55 | - name: Post bumpr status comment 56 | uses: haya14busa/action-bumpr@v1 57 | -------------------------------------------------------------------------------- /.github/workflows/reviewdog.yml: -------------------------------------------------------------------------------- 1 | name: reviewdog 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | jobs: 8 | shellcheck: 9 | name: runner / shellcheck 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v4 13 | - uses: haya14busa/action-cond@v1 14 | id: reporter 15 | with: 16 | cond: ${{ github.event_name == 'pull_request' }} 17 | if_true: "github-pr-review" 18 | if_false: "github-check" 19 | - uses: reviewdog/action-shellcheck@v1 20 | with: 21 | reporter: ${{ steps.reporter.outputs.value }} 22 | level: warning 23 | 24 | shfmt: 25 | name: runner / shfmt 26 | runs-on: ubuntu-latest 27 | steps: 28 | - uses: actions/checkout@v4 29 | - uses: reviewdog/action-shfmt@v1 30 | 31 | actionlint: 32 | name: runner / actionlint 33 | runs-on: ubuntu-latest 34 | steps: 35 | - uses: actions/checkout@v4 36 | - uses: reviewdog/action-actionlint@v1 37 | with: 38 | reporter: github-check 39 | level: warning 40 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | branches: 8 | - main 9 | 10 | jobs: 11 | test-check: 12 | name: runner / linkspector (github-check) 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v4 16 | - uses: ./ 17 | with: 18 | github_token: ${{ secrets.github_token }} 19 | reporter: github-check 20 | level: error 21 | 22 | test-pr-check: 23 | if: github.event_name == 'pull_request' 24 | name: runner / linkspector (github-pr-check) 25 | runs-on: ubuntu-latest 26 | steps: 27 | - uses: actions/checkout@v4 28 | - uses: ./ 29 | with: 30 | github_token: ${{ secrets.github_token }} 31 | reporter: github-pr-check 32 | level: error 33 | 34 | test-pr-review: 35 | if: github.event_name == 'pull_request' 36 | name: runner / linkspector (github-pr-review) 37 | runs-on: ubuntu-latest 38 | steps: 39 | - uses: actions/checkout@v4 40 | - uses: ./ 41 | continue-on-error: true 42 | with: 43 | github_token: ${{ secrets.github_token }} 44 | reporter: github-pr-review 45 | level: error 46 | fail_level: any 47 | - name: check the exit code 48 | if: ${{ !success() }} 49 | run: echo 'The previous step should fail' && exit 1 50 | -------------------------------------------------------------------------------- /.github/workflows/update-linkspector-version.yml: -------------------------------------------------------------------------------- 1 | name: Check and Update Linkspector Version 2 | 3 | on: 4 | schedule: 5 | - cron: '0 */12 * * *' # Run every 12 hours 6 | workflow_dispatch: 7 | 8 | jobs: 9 | check-linkspector-version: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout repository 14 | uses: actions/checkout@v4 15 | 16 | - name: Get current linkspector version from script 17 | id: get_current_version 18 | run: | 19 | current_version=$(grep -oP '@umbrelladocs/linkspector@\K[0-9]+\.[0-9]+\.[0-9]+' script.sh) 20 | echo "CURRENT_VERSION=$current_version" >> $GITHUB_ENV 21 | 22 | - name: Fetch latest linkspector version from NPM 23 | id: get_latest_version 24 | run: | 25 | latest_version=$(npm view @umbrelladocs/linkspector version) 26 | echo "LATEST_VERSION=$latest_version" >> $GITHUB_ENV 27 | 28 | - name: Compare versions and determine bump type 29 | id: compare_versions 30 | run: | 31 | echo "Current version: $CURRENT_VERSION" 32 | echo "Latest version: $LATEST_VERSION" 33 | 34 | current_major=$(echo $CURRENT_VERSION | cut -d'.' -f1) 35 | current_minor=$(echo $CURRENT_VERSION | cut -d'.' -f2) 36 | current_patch=$(echo $CURRENT_VERSION | cut -d'.' -f3) 37 | 38 | latest_major=$(echo $LATEST_VERSION | cut -d'.' -f1) 39 | latest_minor=$(echo $LATEST_VERSION | cut -d'.' -f2) 40 | latest_patch=$(echo $LATEST_VERSION | cut -d'.' -f3) 41 | 42 | echo "Current major: $current_major" 43 | echo "Current minor: $current_minor" 44 | echo "Current patch: $current_patch" 45 | 46 | echo "Latest major: $latest_major" 47 | echo "Latest minor: $latest_minor" 48 | echo "Latest patch: $latest_patch" 49 | 50 | if [ "$latest_major" -ne "$current_major" ]; then 51 | echo "VERSION_BUMP=bump:major" >> $GITHUB_ENV 52 | elif [ "$latest_minor" -ne "$current_minor" ]; then 53 | echo "VERSION_BUMP=bump:minor" >> $GITHUB_ENV 54 | elif [ "$latest_patch" -ne "$current_patch" ]; then 55 | echo "VERSION_BUMP=bump:patch" >> $GITHUB_ENV 56 | else 57 | echo "VERSION_BUMP=bump:patch" >> $GITHUB_ENV 58 | fi 59 | 60 | if [ "$LATEST_VERSION" != "$CURRENT_VERSION" ]; then 61 | echo "NEW_VERSION_AVAILABLE=true" >> $GITHUB_ENV 62 | else 63 | echo "NEW_VERSION_AVAILABLE=false" >> $GITHUB_ENV 64 | fi 65 | 66 | - name: Update script with new version 67 | if: env.NEW_VERSION_AVAILABLE == 'true' 68 | run: | 69 | sed -i "s/@umbrelladocs\/linkspector@$CURRENT_VERSION/@umbrelladocs\/linkspector@$LATEST_VERSION/" script.sh 70 | git config --global user.name 'github-actions[bot]' 71 | git config --global user.email 'github-actions[bot]@users.noreply.github.com' 72 | git add script.sh 73 | git commit -m "Update linkspector version to $LATEST_VERSION" 74 | 75 | - name: Create Pull Request if new version is available 76 | if: env.NEW_VERSION_AVAILABLE == 'true' 77 | uses: peter-evans/create-pull-request@v6 78 | with: 79 | token: ${{ secrets.GITHUB_TOKEN }} 80 | commit-message: Update linkspector version to ${{ env.LATEST_VERSION }} 81 | branch: update-linkspector-version 82 | title: Update linkspector version to ${{ env.LATEST_VERSION }} 83 | body: This PR updates the linkspector version to ${{ env.LATEST_VERSION }} 84 | labels: ${{ env.VERSION_BUMP }} 85 | env: 86 | LATEST_VERSION: ${{ env.LATEST_VERSION }} 87 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Folders to ignore 2 | .vscode/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Gaurav Nelson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![GitHub Marketplace](https://img.shields.io/badge/GitHub%20Marketplace-action%20linkspector-brightgreen?style=for-the-badge)](https://github.com/marketplace/actions/run-linkspector-with-reviewdog) 2 | ![GitHub Release](https://img.shields.io/github/v/release/UmbrellaDocs/action-linkspector?style=for-the-badge) 3 | Donate using Liberapay 4 | 5 | # GitHub action: Run 💀Linkspector with 🐶Reviewdog 6 | 7 | This action runs [Linkspector](https://github.com/UmbrellaDocs/linkspector) with [Reviewdog](https://github.com/reviewdog/reviewdog) on pull requests to improve the quality of your content. 8 | 9 | ## How to use 10 | 11 | 1. Create a new file in your repository `.github/workflows/action.yml`. 12 | 1. Copy-paste the following workflow in your `action.yml` file: 13 | 14 | ```yaml 15 | name: Linkspector 16 | on: [pull_request] 17 | jobs: 18 | check-links: 19 | name: runner / linkspector 20 | runs-on: ubuntu-latest 21 | steps: 22 | - uses: actions/checkout@v4 23 | - name: Run linkspector 24 | uses: umbrelladocs/action-linkspector@v1 25 | with: 26 | github_token: ${{ secrets.github_token }} 27 | reporter: github-pr-review 28 | fail_level: any 29 | ``` 30 | 31 | ## Action inputs 32 | 33 | ### `github_token` 34 | 35 | (Optional) `${{ github.token }}` is used by default. 36 | 37 | ### `level` 38 | 39 | (Optional) Report level for reviewdog [info,warning,error]. 40 | It's same as `-level` flag of reviewdog. Linkspector only reports errors, so if you change this value, you will not see any output. 41 | 42 | ### `reporter` 43 | 44 | Reporter of reviewdog command [github-pr-check,github-pr-review,github-check]. 45 | Default is `github-pr-check`. 46 | `github-pr-review` can use Markdown and add a link to rule page in reviewdog reports. 47 | 48 | For more details, see [Reporters](https://github.com/reviewdog/reviewdog?tab=readme-ov-file#reporters). 49 | 50 | ### `filter_mode` 51 | 52 | (Optional) Filtering mode for the reviewdog command [added,diff_context,file,nofilter], the default value is `added`. 53 | - `added`: Show errors only in the added lines (with the `+` prefix). 54 | - `diff_context`: Show errors in the diff context, that is changed lines +-N lines (N=3 for example). 55 | - `file`: Show errors for added and modified files even if the results are not in actual diff. 56 | - `nofilter`: Show all errors across all files. 57 | 58 | For more details, please see [Filter mode support table](https://github.com/reviewdog/reviewdog?tab=readme-ov-file#filter-mode-support-table). 59 | 60 | ### `fail_level` 61 | 62 | (Optional) Exit code for reviewdog when errors are found with severity greater than or equal to the given level [none,any,info,warning,error]. 63 | Default is `none`. 64 | 65 | ### `fail_on_error` 66 | 67 | (Optional, deprecated) Exit code for reviewdog when errors are found [true,false]. This option is ignored if `fail_level` is used. 68 | Default is `false`. 69 | 70 | ### `reviewdog_flags` 71 | 72 | (Optional) Additional reviewdog flags. 73 | 74 | ### `config_file` 75 | 76 | (Optional) Path to your linkspector configuration file `.linkspector.yml`. 77 | For more details, see [Linkspector configuration](https://github.com/UmbrellaDocs/linkspector?tab=readme-ov-file#configuration). 78 | 79 | ### `show_stats` 80 | 81 | (Optional) Show statistics about the checked links [true,false]. 82 | Default is `false`. 83 | 84 | **Note:** Enabling the `show_stats` option causes Linkspector to run twice: once for reporting and again to collect statistics. Using this will increase the total run time of the action. 85 | 86 | ### Real-life usage samples 87 | 88 | Following is a list of some of the repositories which are using GitHub Action - 89 | Markdown link check. 90 | 91 | 1. [dotnet](https://github.com/dotnet/source-build/blob/main/.github/workflows/check-markdown-links.yml) 92 | 1. [dotnet-docker](https://github.com/dotnet/dotnet-docker/blob/main/.github/workflows/check-markdown-links.yml) 93 | 1. [SAP](https://github.com/SAP/abap-file-formats/blob/main/.github/workflows/markdown-link-check.yml) 94 | 1. [Open Telemetry](https://github.com/open-telemetry/opentelemetry-ruby/blob/main/.github/workflows/ci-markdown-link.yml) 95 | 1. [More](https://github.com/search?q=uses%3A+umbrelladocs%2Faction-linkspector%40v1&type=code) 96 | 97 | If you are using this on production, consider [buying me a coffee](https://liberapay.com/gaurav-nelson/) ☕. 98 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Run Linkspector with reviewdog 3 | description: Run 💀Linkspector with 🐶reviewdog on pull requests to uncover 4 | broken links in your content. 5 | author: Gaurav Nelson 6 | inputs: 7 | github_token: 8 | description: GITHUB_TOKEN 9 | default: ${{ github.token }} 10 | workdir: 11 | description: Working directory relative to the root directory. 12 | default: . 13 | tool_name: 14 | description: Tool name to use for reviewdog reporter. 15 | default: Linkspector 16 | level: 17 | description: Report level for reviewdog [info,warning,error]. 18 | default: error 19 | reporter: 20 | description: Reporter of reviewdog command [github-check,github-pr-review,github-pr-check]. 21 | default: github-check 22 | filter_mode: 23 | description: > 24 | Filtering mode for the reviewdog command 25 | [added,diff_context,file,nofilter]. Default is added. 26 | default: added 27 | fail_level: 28 | description: > 29 | Exit code for reviewdog when errors are found with severity greater 30 | than or equal to the given level [none,any,info,warning,error]. Default is 31 | `none`. 32 | default: "" 33 | fail_on_error: 34 | description: > 35 | (Deprecated) Exit code for reviewdog when errors are found 36 | [true,false]. This option is ignored if you use `fail_level`. Default is 37 | `false`. 38 | default: "false" 39 | reviewdog_flags: 40 | description: Additional reviewdog flags. 41 | default: "" 42 | config_file: 43 | description: Specify the path for the Linkspector YML configuration file. 44 | required: true 45 | default: .linkspector.yml 46 | show_stats: 47 | description: Show statistics about the checked links. 48 | required: false 49 | default: "false" 50 | runs: 51 | using: composite 52 | steps: 53 | - uses: actions/setup-node@v4 54 | with: 55 | node-version: 20 56 | - uses: reviewdog/action-setup@v1 57 | with: 58 | reviewdog_version: v0.20.3 59 | - run: | 60 | if [ -n "${INPUT_FAIL_LEVEL}" ]; then 61 | echo "INPUT_FAIL_LEVEL=${INPUT_FAIL_LEVEL}" >> "${GITHUB_ENV}" 62 | elif [ "${INPUT_FAIL_ON_ERROR}" = "true" ]; then 63 | echo "INPUT_FAIL_LEVEL=any" >> "${GITHUB_ENV}" 64 | else 65 | echo "INPUT_FAIL_LEVEL=none" >> "${GITHUB_ENV}" 66 | fi 67 | shell: bash 68 | env: 69 | INPUT_FAIL_LEVEL: ${{ inputs.fail_level }} 70 | INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }} 71 | - run: $GITHUB_ACTION_PATH/script.sh 72 | shell: bash 73 | env: 74 | INPUT_GITHUB_TOKEN: ${{ inputs.github_token }} 75 | INPUT_WORKDIR: ${{ inputs.workdir }} 76 | INPUT_TOOL_NAME: ${{ inputs.tool_name }} 77 | INPUT_LEVEL: ${{ inputs.level }} 78 | INPUT_REPORTER: ${{ inputs.reporter }} 79 | INPUT_FILTER_MODE: ${{ inputs.filter_mode }} 80 | INPUT_FAIL_LEVEL: ${{ env.INPUT_FAIL_LEVEL }} 81 | INPUT_REVIEWDOG_FLAGS: ${{ inputs.reviewdog_flags }} 82 | INPUT_CONFIG_FILE: ${{ inputs.config_file }} 83 | INPUT_SHOW_STATS: ${{ inputs.show_stats }} 84 | branding: 85 | icon: link-2 86 | color: blue 87 | -------------------------------------------------------------------------------- /script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | if [ -n "${GITHUB_WORKSPACE}" ]; then 5 | cd "${GITHUB_WORKSPACE}/${INPUT_WORKDIR}" || exit 6 | fi 7 | 8 | export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" 9 | 10 | echo '::group::🔗💀 Installing linkspector ... https://github.com/UmbrellaDocs/linkspector' 11 | npm install -g @umbrelladocs/linkspector@0.4.4 12 | echo '🔗💀 linkspector version:' 13 | linkspector --version 14 | echo '::endgroup::' 15 | 16 | echo '::group::🔗💀 Setting up Chrome Linux Sandbox' 17 | # Based on the instructions found here: https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md 18 | if [ "$(lsb_release -rs)" = "24.04" ]; then 19 | echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns 20 | echo 'Done' 21 | fi 22 | 23 | echo '::endgroup::' 24 | 25 | echo '::group:: Running linkspector with reviewdog 🐶 ...' 26 | linkspector check -c "${INPUT_CONFIG_FILE}" -j | 27 | reviewdog -f=rdjson \ 28 | -name="${INPUT_TOOL_NAME}" \ 29 | -reporter="${INPUT_REPORTER}" \ 30 | -filter-mode="${INPUT_FILTER_MODE}" \ 31 | -fail-level="${INPUT_FAIL_LEVEL}" \ 32 | -level="${INPUT_LEVEL}" \ 33 | "${INPUT_REVIEWDOG_FLAGS}" 34 | exit_code=$? 35 | echo '::endgroup::' 36 | 37 | if [ "${INPUT_SHOW_STATS}" = "true" ]; then 38 | echo '::group:: Running linkspector stats ...' 39 | linkspector check -c "${INPUT_CONFIG_FILE}" -s || true 40 | echo '::endgroup::' 41 | fi 42 | 43 | exit $exit_code 44 | -------------------------------------------------------------------------------- /testdata/subdir/text.md: -------------------------------------------------------------------------------- 1 | This is a test file. 2 | 3 | It contains a working link to [another file](../text.md). 4 | -------------------------------------------------------------------------------- /testdata/text.md: -------------------------------------------------------------------------------- 1 | This is a test file. 2 | 3 | It contains a broken link to [another file](testdata/does-not-exist.md). 4 | 5 | And a working hyperlink to [Google](https://www.google.com). 6 | --------------------------------------------------------------------------------