GitHub Action
Run remark-lint
v1.0.3
Latest version
This action runs the remark-lint linter to check/format your markdown code on a push or pull request.
name: remark-lint-action
on: [push, pull_request]
jobs:
remark-lint:
name: runner / remark-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: remark-lint
uses: rickstaa/action-remark-lint@v1
optional: Remark-lint input arguments. Defaults to . --frail --quiet
.
optional: Exit code when remark-lint linting errors are found [true, false]. Defaults to 'true'.
Boolean specifying whether any files were formatted using the remark-lint linter.
This action can be combined with reviewdog/action-suggester also to annotate any possible changes (uses git diff
).
name: remark-lint-action
on: [push, pull_request]
jobs:
name: runner / remark-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check files using the remark-lint linter
uses: rickstaa/action-remark-lint@v1
id: action_remark_lint
with:
remark_args: ". -o"
- name: Annotate diff changes using reviewdog
if: steps.action_remark_lint.outputs.is_formatted == 'true'
uses: reviewdog/action-suggester@v1
with:
tool_name: remarkfmt
This action can be combined with peter-evans/create-pull-request to also apply the annotated changes to the repository.
name: remark-lint-action
on: [push, pull_request]
jobs:
name: runner / remark-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check files using remark-lint linter
uses: rickstaa/action-remark-lint@v1
id: action_remark_lint
with:
remark_args: ". -o"
- name: Create Pull Request
if: steps.action_remark_lint.outputs.is_formatted == 'true'
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "Format Python code with remark-lint linter"
commit-message: ":art: Format Python code with remark-lint"
body: |
There appear to be some python formatting errors in ${{ github.sha }}. This pull request
uses the [remark-lint](https://github.com/remarkjs/remark-lint) linter to fix these issues.
base: ${{ github.head_ref }} # Creates pull request onto pull request or commit branch
branch: actions/remark-lint