General

Grammar Check CI Pipeline in GitHub Actions for PRs and Issues

2026-11-06 · 5 min · Lint Team

Why grammar checks belong in your CI pipeline



Pull requests and issues are the primary places where developers communicate intent, document changes, and raise questions. A typo in a PR description can confuse reviewers, while a misplaced modifier in an issue can derail a conversation. Automating a grammar check at the CI level means errors are caught before a human has to spend time pointing them out. For teams that already run build and test checks in GitHub Actions, adding a grammar check is a natural extension: it runs on the same trigger, uses the same fail/succeed signal, and gives contributors immediate feedback.

What you can check automatically



A grammar check CI pipeline can validate several text sources in your repository:

- Pull request descriptions: The body of a PR, including markdown formatting and code snippets.
- Issue bodies: The initial description of an issue, where clear bug reports and feature requests matter.
- Comments: Issue comments and review comments can also be checked, though you may want to limit this to avoid noise.
- Markdown documentation: Files like README.md, CONTRIBUTING.md, and docs pages can be checked on every push.

The examples in this guide focus on PR descriptions and issue bodies because they are the highest-leverage places for grammar checks in a GitHub Actions workflow.

Choosing a grammar checking engine



Before you write the workflow, decide which grammar engine fits your team. The two main categories are rule-based grammar checkers and developer-focused APIs that combine proofreading with style suggestions.

The table below compares common options:

| Tool | Strengths | Setup complexity | Best for |
|------|-----------|------------------|----------|
| LanguageTool | Open-source, supports many languages, can be self-hosted | Low to medium | Teams that want a free or self-hosted grammar engine |
| Lint API | Developer-focused, clean JSON suggestions, proofreading and paraphrasing endpoints | Low | Dev teams that want grammar plus style checks in one API |
| Vale | Highly configurable style linting, custom vocabulary rules | Medium to high | Docs-heavy repositories with strict style guides |
| textlint | Pluggable JavaScript linting, large rule ecosystem | Medium | JavaScript and TypeScript projects |

LanguageTool is a solid default because it is open source and has a public API. Lint API is worth considering if you want a single service for grammar, style, and phrasing suggestions without self-hosting. Vale and textlint are stronger when you need to enforce a custom style guide across many documentation files.

Setting up LanguageTool with GitHub Actions



The easiest way to start is with the public LanguageTool API. For higher volume or private text, you can self-host LanguageTool as a container and point the workflow to your own instance.

Create a workflow file at .github/workflows/grammar-check.yml:

``
name: Grammar Check
on:
pull_request:
types: [opened, edited, synchronize]
issues:
types: [opened, edited]

jobs:
grammar-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Run grammar check on PR or issue body
env:
GITHUB_EVENT_PATH: ${{ github.event_path }}
run: node .github/scripts/grammar-check.js
`

The script reads the event payload, extracts the PR description or issue body, and sends it to LanguageTool. Save the following as
.github/scripts/grammar-check.js:

`
const fs = require('fs');

async function main() {
const event = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8'));
const text = event.pull_request?.body || event.issue?.body || '';

if (!text.trim()) {
console.log('No PR description or issue body found. Skipping grammar check.');
return;
}

const response = await fetch('https://api.languagetool.org/v2/check', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({ text, language: 'en-US' })
});

const data = await response.json();

if (!data.matches || data.matches.length === 0) {
console.log('No grammar issues found.');
return;
}

console.log(
Found ${data.matches.length} potential grammar issue(s):);
for (const match of data.matches) {
const context = match.context?.text || '';
const offset = match.context?.offset || 0;
const length = match.context?.length || 0;
const snippet = context.slice(offset, offset + length);
console.log(
- ${match.message} (${snippet}));
}

process.exit(1);
}

main().catch((error) => {
console.error(error);
process.exit(1);
});
`

This workflow fails the check if LanguageTool finds any matches, which shows up as a red X on the PR. You can adjust the script to only fail on certain rule categories or to post a comment instead of failing.

Integrating Lint API as an alternative



If you prefer a developer-focused API that returns structured JSON with both grammar and style suggestions, Lint API is a natural fit. The setup follows the same pattern: extract the text from the GitHub event, send it to the API, and fail or comment based on the response.

A minimal workflow step might look like this:

`
- name: Run Lint API grammar check
env:
LINT_API_KEY: ${{ secrets.LINT_API_KEY }}
GITHUB_EVENT_PATH: ${{ github.event_path }}
run: node .github/scripts/lint-check.js
`

The
lint-check.js script would read the event payload, extract the PR or issue body, and POST it to Lint API with your key. Because Lint API returns suggestions in a consistent JSON shape, you can pipe the output to a small script that posts inline comments or updates the check run. The exact endpoint and response fields depend on your Lint plan, so refer to the API documentation for your current version.

Compared with LanguageTool, Lint API often requires less post-processing because it is designed for programmatic use from the start.

Handling false positives and custom rules



No grammar checker is perfect. Technical terms, product names, and code identifiers will sometimes trigger false positives. You can reduce noise in LanguageTool by passing the
ignoredWords parameter or by disabling specific rule IDs:

`
const params = new URLSearchParams({
text,
language: 'en-US',
ignoredWords: 'GitHub,API,PR',
disabledRules: 'UPPERCASE_SENTENCE_START'
});
`

Lint API similarly allows custom dictionaries and rule toggles through its request payload or project settings. Vale and textlint are even more configurable if your team maintains a formal style guide.

Start with the default rules and add exceptions as real false positives appear. This keeps the pipeline useful without training contributors to ignore it.

Testing your pipeline locally



Before pushing the workflow, you can test the grammar check script locally. Run:

`
node .github/scripts/grammar-check.js
`

with a local copy of the event payload. GitHub provides sample event payloads for pull requests and issues in the repository settings, or you can use the
act tool to simulate the workflow:

`
act pull_request -j grammar-check
`

This catches syntax errors in the workflow file and confirms that the API calls work with your secrets.

Conclusion



Adding a grammar check CI pipeline to GitHub Actions is a small change that improves the clarity of PR descriptions and issues. LanguageTool gives you an open-source starting point, while Lint API offers a developer-friendly alternative with grammar and style checks in one API. Pick one engine, wire it to the
pull_request and issues` events, and let the CI signal do the proofreading work before your team has to.

Check your own text — free



Paste a commit message, PR description, or code comment into the free Lint grammar checker. It proofreads the prose and leaves identifiers, commands, and fenced code blocks untouched — no signup needed for your first checks.
📌 Prices and tool count in this article may be outdated. Lint now ships 16 tools with Pro at $12/mo, or $60/year. See the current pricing page.
Try Lint free — no signup, code-aware
Free · no account needed · open full toolkit →
L
Lint Team
Lint Tools — AI writing for developers

Stop letting Grammarly break your code

17 AI tools built for developers. Code-aware parsing.

Try free — no signup View pricing
Or upgrade to Pro for 500 checks a day · All tools · No ads

Need more than free tools?

Unlock 500 checks a day, larger text capacity, and priority support.

View pricing → Upgrade Lint — Pro $12/mo or $60/yr
💬