https://github.com/zentered/markdown-seo-check
GitHub Action to validate markdown files with SEO best practices. Creates a pull request comment and fails if conditions are not met.
https://github.com/zentered/markdown-seo-check
Last synced: about 1 year ago
JSON representation
GitHub Action to validate markdown files with SEO best practices. Creates a pull request comment and fails if conditions are not met.
- Host: GitHub
- URL: https://github.com/zentered/markdown-seo-check
- Owner: zentered
- License: mit
- Created: 2021-03-05T08:28:19.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-09-04T20:39:09.000Z (almost 2 years ago)
- Last Synced: 2025-04-02T23:05:58.727Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 1.21 MB
- Stars: 8
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Markdown SEO Check
Validate markdown files with SEO best practices. Creates a pull request comment
and fails if conditions are not met.
## Table of Contents
- [Usage](#usage)
- [Inputs](#inputs)
- [Outputs](#outputs)
## Usage
If your repo is public and you have pull requests from forks,
`pull_request_target` is required, as this Action creates a comment on a Pull
Request and therefore requires read/write permissions. Read more about the
`pull_request_target` trigger
[here](https://securitylab.github.com/research/github-actions-preventing-pwn-requests).
If your repo is private, you can change this to `pull_request` and remove the
`ref` in the checkout action.
```yaml
name: check
on: pull_request_target
jobs:
seocheck:
name: Markdown SEO Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Markdown SEO Check
uses: zentered/markdown-seo-check@v1.1.0
with:
max_title_length: 70
max_description_length: 150
max_slug_length: 100
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
## Inputs
| Name | Requirement | Default | Description |
| ------------------------ | ----------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `includes` | optional | `{*.md,*.mdx}` | Glob to include specific files or folders. See [glob-to-regexp usage](https://www.npmjs.com/package/glob-to-regexp#usage) for examples. |
| `excludes` | optional | '' | Glob to exclude files or folders |
| `max_title_length` | required | 70 | Maximum length of page title |
| `max_description_length` | required | 150 | Maximum length of description |
| `max_slug_length` | required | 100 | Maximum length of slug |
## Outputs

## Contributing
See [CONTRIBUTING](CONTRIBUTING.md).
## License
See [LICENSE](LICENSE).