Skip to content

Commit

Permalink
Updated files, descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav-nelson committed May 14, 2024
1 parent 319ff1b commit 3b20a4f
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 52 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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() }}
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
59 changes: 35 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -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`

Expand All @@ -11,17 +33,25 @@ 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`

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`

Expand All @@ -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).
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -11,7 +11,7 @@ inputs:
### Flags for reviewdog ###
tool_name:
description: 'Tool name to use for reviewdog reporter.'
default: '<linter-name>'
default: 'Linkspector'
level:
description: 'Report level for reviewdog [info,warning,error].'
default: 'error'
Expand Down
4 changes: 2 additions & 2 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3b20a4f

Please sign in to comment.