|
1 |
| -# Reviewdog/action-remark-lint GitHub Action |
| 1 | +# Action-remark-lint GitHub Action |
2 | 2 |
|
3 |
| -[](https://github.com/reviewdog/action-remark-lint/actions?query=workflow%3ATest) |
4 |
| -[](https://github.com/reviewdog/action-remark-lint/actions?query=workflow%3Areviewdog) |
5 |
| -[](https://github.com/reviewdog/action-remark-lint/actions?query=workflow%3Adepup) |
6 |
| -[](https://github.com/reviewdog/action-remark-lint/actions?query=workflow%3Arelease) |
7 |
| -[](https://github.com/reviewdog/action-remark-lint/releases) |
| 3 | +[](https://github.com/rickstaa/action-remark-lint/actions?query=workflow%3ATest) |
| 4 | +[](https://github.com/rickstaa/action-remark-lint/actions?query=workflow%3Arelease) |
| 5 | +[](https://github.com/rickstaa/action-remark-lint/releases) |
8 | 6 | [](https://github.com/haya14busa/action-bumpr)
|
9 | 7 |
|
10 |
| - |
11 |
| - |
12 |
| - |
13 |
| -This action runs [remark-lint](https://github.com/remarkjs/remark-lint) with [reviewdog](https://github.com/reviewdog/reviewdog) on pull requests to improve code review experience. It can be used to format your code and/or annotate possible changes that would be made during this formatting. |
| 8 | +This action runs the [remark-lint linter](https://github.com/remarkjs/remark-lint) to check/format your markdown code on a push or pull request. |
14 | 9 |
|
15 | 10 | ## Quickstart
|
16 | 11 |
|
17 | 12 | ```yml
|
18 |
| -name: reviewdog |
19 |
| -on: [pull_request] |
| 13 | +name: remark-lint-action |
| 14 | +on: [push, pull_request] |
20 | 15 | jobs:
|
21 | 16 | remark-lint:
|
22 | 17 | name: runner / remark-lint
|
23 | 18 | runs-on: ubuntu-latest
|
24 | 19 | steps:
|
25 | 20 | - uses: actions/checkout@v1
|
26 | 21 | - name: remark-lint
|
27 |
| - uses: reviewdog/action-remark-lint@v1 |
28 |
| - with: |
29 |
| - github_token: ${{ secrets.GITHUB_TOKEN }} |
30 |
| - reporter: github-pr-check # Change reporter. (Only `github-pr-check` is supported at the moment). |
| 22 | + uses: rickstaa/action-remark-lint@v1 |
31 | 23 | ```
|
32 | 24 |
|
33 |
| -See the Inputs section below for details on the defaults and optional configuration settings. |
34 |
| -
|
35 | 25 | ## Inputs
|
36 | 26 |
|
37 |
| -### `github_token` |
38 |
| - |
39 |
| -**Required**. Must be in form of `github_token: ${{ secrets.github_token }}`'. |
40 |
| - |
41 |
| -### `workdir` |
42 |
| - |
43 |
| -**Optional**. The directory to run remark-lint in. Defaults to `.`. |
44 |
| - |
45 |
| -### `format` |
46 |
| - |
47 |
| -**Optional**. If true, remark-lint format files and commit are creatable (use other Action). Defaults to `false`. |
48 |
| - |
49 |
| -#### `fail_on_error` |
50 |
| - |
51 |
| -**Optional**. Exit code for when remark-lint errors are found \[`true`, `false`]. Defaults to `false`. This is different than the remark-lint `--frail` argument, which specifies whether remark exits with an exit code of `1` if remark warnings are found. |
52 |
| - |
53 |
| -#### `remark_flags` |
54 |
| - |
55 |
| -**Optional**. Additional remark-lint flags. Defaults to `""`. |
56 |
| - |
57 |
| -### `annotate` |
| 27 | +### `remark_args` |
58 | 28 |
|
59 |
| -**Optional**. Annotate remark-lint changes using reviewdog. Defaults to `true`. |
| 29 | +**optional**: Remark-lint input arguments. Defaults to `. --frail --quiet`. |
60 | 30 |
|
61 |
| -#### `tool_name` |
| 31 | +### `fail_on_error` |
62 | 32 |
|
63 |
| -**Optional**. Tool name to use for reviewdog reporter. Defaults to `remark-lint`. |
64 |
| - |
65 |
| -### `level` |
66 |
| - |
67 |
| -**Optional**. Report level for reviewdog \[info, warning, error]. It's same as `-level` flag of reviewdog. Defaults to `error`. |
68 |
| - |
69 |
| -### `reporter` |
70 |
| - |
71 |
| -**Optional**. Reporter of reviewdog command \[github-pr-check, github-pr-review, github-check]. |
72 |
| -Default is github-pr-check. github-pr-review can use Markdown and add a link to rule page in reviewdog reports. |
73 |
| - |
74 |
| -### `filter_mode` |
75 |
| - |
76 |
| -**Optional**. Filtering mode for the reviewdog command \[added, diff_context, file, nofilter]. Defaults to `"added"`. |
77 |
| - |
78 |
| -### `reviewdog_flags` |
79 |
| - |
80 |
| -**Optional**. Additional reviewdog flags. Defaults to `""`. |
| 33 | +**optional**: Exit code when remark-lint linting errors are found \[true, false]. Defaults to 'true'. |
81 | 34 |
|
82 | 35 | ## Outputs
|
83 | 36 |
|
84 | 37 | ### `is_formatted`
|
85 | 38 |
|
86 |
| -Whether the files were formatted using the remark-lint linter. |
| 39 | +Boolean specifying whether any files were formatted using the remark-lint linter. |
87 | 40 |
|
88 |
| -## Advance use cases |
| 41 | +## Advanced use cases |
89 | 42 |
|
90 |
| -This action can be combined with [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) or [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) to also apply the annotated changes to the repository. |
| 43 | +### Annotate changes |
91 | 44 |
|
92 |
| -### Commit changes |
| 45 | +This action can be combined with [reviewdog/action-suggester](https://github.com/reviewdog/action-suggester) also to annotate any possible changes (uses `git diff`). |
93 | 46 |
|
94 | 47 | ```yaml
|
95 |
| -name: reviewdog |
96 |
| -on: [pull_request] |
| 48 | +name: remark-lint-action |
| 49 | +on: [push, pull_request] |
97 | 50 | jobs:
|
98 | 51 | name: runner / remark-lint
|
99 | 52 | runs-on: ubuntu-latest
|
100 | 53 | steps:
|
101 | 54 | - uses: actions/checkout@v2
|
| 55 | + - name: Check files using the remark-lint linter |
| 56 | + uses: rickstaa/action-remark-lint@v1 |
| 57 | + id: action_remark_lint |
102 | 58 | with:
|
103 |
| - ref: ${{ github.head_ref }} |
104 |
| - - name: Check files using remark-lint linter |
105 |
| - uses: reviewdog/action-remark-lint@v1 |
| 59 | + remark_args: ". -o" |
| 60 | + - name: Annotate diff changes using reviewdog |
| 61 | + if: steps.action_remark_lint.outputs.is_formatted == 'true' |
| 62 | + uses: reviewdog/action-suggester@v1 |
106 | 63 | with:
|
107 |
| - github_token: ${{ secrets.GITHUB_TOKEN }} |
108 |
| - reporter: github-check |
109 |
| - level: error |
110 |
| - fail_on_error: true |
111 |
| - format: true |
112 |
| - - name: Commit remark-lint formatting results |
113 |
| - if: failure() |
114 |
| - uses: stefanzweifel/git-auto-commit-action@v4 |
115 |
| - with: |
116 |
| - commit_message: ":art: Format markdown code with remark-lint push" |
| 64 | + tool_name: remarkfmt |
117 | 65 | ```
|
118 | 66 |
|
119 |
| -### Create pull request |
| 67 | +### Commit changes or create a pull request |
| 68 | + |
| 69 | +This action can be combined with [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) to also apply the annotated changes to the repository. |
120 | 70 |
|
121 | 71 | ```yaml
|
122 |
| -name: reviewdog |
123 |
| -on: [pull_request] |
| 72 | +name: remark-lint-action |
| 73 | +on: [push, pull_request] |
124 | 74 | jobs:
|
125 | 75 | name: runner / remark-lint
|
126 | 76 | runs-on: ubuntu-latest
|
127 | 77 | steps:
|
128 | 78 | - uses: actions/checkout@v2
|
129 | 79 | - name: Check files using remark-lint linter
|
130 |
| - uses: reviewdog/action-remark-lint@v1 |
| 80 | + uses: rickstaa/action-remark-lint@v1 |
| 81 | + id: action_remark_lint |
131 | 82 | with:
|
132 |
| - github_token: ${{ secrets.GITHUB_TOKEN }} |
133 |
| - reporter: github-check |
134 |
| - level: error |
135 |
| - fail_on_error: true |
136 |
| - format: true |
| 83 | + remark_args: ". -o" |
137 | 84 | - name: Create Pull Request
|
138 |
| - if: failure() |
| 85 | + if: steps.action_remark_lint.outputs.is_formatted == 'true' |
139 | 86 | uses: peter-evans/create-pull-request@v3
|
140 | 87 | with:
|
141 | 88 | token: ${{ secrets.GITHUB_TOKEN }}
|
142 |
| - title: "Format markdown code with remark-lint linter" |
143 |
| - commit-message: ":art: Format markdown code with remark-lint linter" |
| 89 | + title: "Format Python code with remark-lint linter" |
| 90 | + commit-message: ":art: Format Python code with remark-lint" |
144 | 91 | body: |
|
145 | 92 | There appear to be some python formatting errors in ${{ github.sha }}. This pull request
|
146 | 93 | uses the [remark-lint](https://github.com/remarkjs/remark-lint) linter to fix these issues.
|
| 94 | + base: ${{ github.head_ref }} # Creates pull request onto pull request or commit branch |
147 | 95 | branch: actions/remark-lint
|
148 | 96 | ```
|
0 commit comments