From 3b20a4f151e16aaaac1572df147620e50741be40 Mon Sep 17 00:00:00 2001 From: Gaurav Date: Tue, 14 May 2024 21:39:24 +1000 Subject: [PATCH] Updated files, descriptions --- .github/workflows/reviewdog.yml | 21 ------------ .github/workflows/test.yml | 2 -- LICENSE | 2 +- README.md | 59 +++++++++++++++++++-------------- action.yml | 4 +-- script.sh | 4 +-- 6 files changed, 40 insertions(+), 52 deletions(-) diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index e4766b2..c0a601a 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -37,24 +37,3 @@ jobs: with: reporter: github-check level: warning - - misspell: - name: runner / misspell - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: reviewdog/action-misspell@v1 - with: - reporter: github-check - level: warning - locale: "US" - - alex: - name: runner / alex - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: reviewdog/action-alex@v1 - with: - reporter: github-check - level: warning diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 61f6a7f..4a5b221 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,6 @@ jobs: github_token: ${{ secrets.github_token }} reporter: github-pr-check level: error - workdir: ./testdata/subdir/ test-pr-review: if: github.event_name == 'pull_request' @@ -44,7 +43,6 @@ jobs: github_token: ${{ secrets.github_token }} reporter: github-pr-review level: error - filter_mode: file fail_on_error: true - name: check the exit code if: ${{ !success() }} diff --git a/LICENSE b/LICENSE index 4abeaba..39c9758 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 reviewdog developers +Copyright (c) 2024 Gaurav Nelson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 52b5a1a..7e547a6 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,30 @@ -# GitHub action: Run Linkspector with Reviewdog +# GitHub action: Run 💀Linkspector with 🐶Reviewdog 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. -## Inputs +## How to use + +1. Create a new file in your repository `.github/workflows/action.yml`. +1. Copy-paste the following workflow in your `action.yml` file: + + ```yaml + name: Linkspector + on: [pull_request] + jobs: + check-links: + name: runner / linkspector + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run linkspector + uses: umbrelladocs/action-linkspector@v1 + with: + github_token: ${{ secrets.github_token }} + reporter: github-pr-review + fail_on_error: true + ``` + +## Action inputs ### `github_token` @@ -11,7 +33,7 @@ This action runs [Linkspector](https://github.com/UmbrellaDocs/linkspector) with ### `level` (Optional) Report level for reviewdog [info,warning,error]. -It's same as `-level` flag of reviewdog. +It's same as `-level` flag of reviewdog. Linkspector only reports errors, so if you change this value, you will not see any output. ### `reporter` @@ -19,9 +41,17 @@ Reporter of reviewdog command [github-pr-check,github-pr-review,github-check]. Default is `github-pr-check`. `github-pr-review` can use Markdown and add a link to rule page in reviewdog reports. +For more details, see [Reporters](https://github.com/reviewdog/reviewdog?tab=readme-ov-file#reporters). + ### `filter_mode` -(Optional) Filtering mode for the reviewdog command [added,diff_context,file,nofilter], the default value is `file`. +(Optional) Filtering mode for the reviewdog command [added,diff_context,file,nofilter], the default value is `added`. +- `added`: Show errors only in the added lines (with the `+` prefix). +- `diff_context`: Show errors in the diff context, that is changed lines +-N lines (N=3 for example). +- `file`: Show errors for added and modified files even if the results are not in actual diff. +- `nofilter`: Show all errors across all files. + +For more details, please see [Filter mode support table](https://github.com/reviewdog/reviewdog?tab=readme-ov-file#filter-mode-support-table). ### `fail_on_error` @@ -35,23 +65,4 @@ Default is `false`. ### `config_file` (Optional) Path to your linkspector configuration file `.linkspector.yml`. - -## Example usage - -```yaml -name: Linkspector -on: [pull_request] -jobs: - linkspector: - name: runner / linkspector - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: linkspector - uses: reviewdog/action-linkspector@v1 - with: - github_token: ${{ secrets.github_token }} - reporter: github-pr-review # Change reporter. -``` - - +For more details, see [Linkspector configuration](https://github.com/UmbrellaDocs/linkspector?tab=readme-ov-file#configuration). diff --git a/action.yml b/action.yml index 691a38c..12a1b33 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ name: 'Run Linkspector with reviewdog' -description: '🐶 Run Linkspector with reviewdog on pull requests to improve code review experience.' +description: 'Run 💀Linkspector with 🐶reviewdog on pull requests to uncover broken links in your content.' author: 'Gaurav Nelson' inputs: github_token: @@ -11,7 +11,7 @@ inputs: ### Flags for reviewdog ### tool_name: description: 'Tool name to use for reviewdog reporter.' - default: '' + default: 'Linkspector' level: description: 'Report level for reviewdog [info,warning,error].' default: 'error' diff --git a/script.sh b/script.sh index bc7eeeb..f473f3e 100755 --- a/script.sh +++ b/script.sh @@ -13,13 +13,13 @@ echo '::endgroup::' echo '::group:: Running linkspector with reviewdog 🐶 ...' linkspector check -c "${INPUT_CONFIG_FILE}" -j | - reviewdog -efm="%f:%l:%c: %m" \ + reviewdog -f=rdjson \ -name="${INPUT_TOOL_NAME}" \ -reporter="${INPUT_REPORTER}" \ -filter-mode="${INPUT_FILTER_MODE}" \ -fail-on-error="${INPUT_FAIL_ON_ERROR}" \ -level="${INPUT_LEVEL}" \ - ${INPUT_REVIEWDOG_FLAGS} + "${INPUT_REVIEWDOG_FLAGS}" exit_code=$? echo '::endgroup::' exit $exit_code