Introduction
“Optimizing the article review process with AI and GitHub is now easier than ever. By leveraging the powerful capabilities of the Gradient platform, you can build a GitHub Action that automates grammar and style checks for your technical writing. This solution streamlines the review of markdown files, saving valuable time by reducing manual effort. With AI trained on your writing style, the system ensures consistency and quality across all documents. In this tutorial, we will guide you through creating a custom GitHub Action on the Gradient platform that accelerates the review process, making technical writing faster and more efficient.”
What is GitHub Action for AI-powered grammar and style review?
This solution automates the process of reviewing writing by integrating an AI-powered tool into a GitHub workflow. It checks markdown files for grammatical errors, style inconsistencies, and formatting issues, providing suggestions for improvement. By leveraging AI trained on specific writing guides, it significantly speeds up the review process, reducing manual effort and review time.
Prerequisites
Alright, let’s get started by looking at what you’ll need before you dive in. First up, you should have a basic understanding of YAML. Don’t worry, it’s not as scary as it sounds! YAML (Yet Another Markup Language) is a simple, human-friendly way of organizing data. You’ll see it all over in GitHub Actions workflows, and it’s super important for defining the rules and steps that your action will follow. You can think of it like a recipe—YAML tells your action exactly what ingredients (or steps) to use and in what order.
Next, you’ll need to know a little JavaScript. If you’re thinking about tweaking or building custom scripts that work with your GitHub Action, this is where JavaScript comes in handy. It’s not just about making things work; it’s about making them work smoothly. JavaScript helps you handle things like automation logic, making API requests, or connecting your action to other services. It’s kind of like the backbone of your action, making sure everything works together.
And here’s the deal—you’ll also need a Cloud Server account to use the Caasify platform. This is where the magic happens. Caasify is the place where you’ll train your AI agent to understand your team’s or company’s writing style and preferences. It’s like setting up a personal assistant who learns exactly how you like things done, so it can help with grammar checks and style fixes in your markdown files. Caasify has all the tools you need to build, train, and deploy AI agents that will power your GitHub Action. Just make sure your Caasify account is all set up and ready to go. It’s the foundation you’ll need to deploy and use your AI agents like a pro.
Make sure your Caasify account is all set up and ready to go.
Web Design Standards
The Problem and How to Solve It?
Picture this: you’re buried in a huge pile of technical documents. You’ve got to go through all of them, checking for grammar, inconsistencies, and making sure they follow your company’s writing style. It’s a lot, right? And when the workload is heavy, it can feel like the reviews just never end. You’re juggling multiple checks, and each document needs a deep dive. Days slip by, and before you know it, the backlog is growing faster than you can keep up with.
Now, here’s the thing: human reviewers are essential, but they come with their own challenges. People get tired, they miss things, and sometimes mistakes slip through the cracks. Next thing you know, you’re fixing problems that should’ve been caught earlier. That’s when it starts to get frustrating.
But don’t worry—there’s a way out. Imagine this: instead of getting buried under manual checks, you could set up a GitHub Action that uses Artificial Intelligence (AI) to handle the entire process for you. This AI is trained specifically on your team’s unique writing style. It learns the ins and outs of your technical guides, the tone you prefer, and the format you rely on. It’s like having an intern who already knows everything you care about. This AI agent goes through your markdown files, quickly spotting grammar mistakes, inconsistencies, and style issues. It doesn’t stop there—it also offers suggestions to help improve the text. With AI doing the heavy lifting, the time spent on reviews is drastically reduced. What might take days of manual effort now gets done in just seconds.
And here’s the best part: you don’t have to build it all from scratch. The GitHub Action that uses this AI is already available on the marketplace. You can easily integrate it into your repositories, and just like that, it’s ready to work for you, trained on your data.
Let’s break it down into two simple steps:
- First, you deploy a Caasify Cloud Server agent . This agent is trained on your tutorials and will be the one analyzing and reviewing your markdown files.
- Second, you add the workflow file to your repositories. This file lets the GitHub Action fit right into your development process.
Once everything’s set up, you’re good to go! Your content will be reviewed faster, and your documents will always be consistent and error-free.
This process takes the manual, error-prone task of reviewing content and turns it into something fast, efficient, and reliable. No more piles of unchecked documents, no more errors slipping through. It’s smooth sailing with your AI-powered assistant by your side.
Building the Caasify Cloud Server Agent
Imagine this: You’ve just wrapped up a project, and now it’s time to review your markdown files. But hold on, you know the drill—those manual reviews are time-consuming and can get pretty repetitive, especially when you’ve got tons of documents to go through. Here’s the exciting part: you don’t have to do all the work anymore. What if you could have an AI agent on the Caasify Cloud Server platform do the heavy lifting for you? It’s like having a super-smart assistant who knows your team’s writing style inside and out, making sure every document you create meets the exact standards you’ve set. So, let’s get started on building this AI-powered agent!
First things first, you need to create and index a knowledge base using your team’s tutorials and documentation. And don’t worry—it’s simple! Just log in to the Caasify platform, head over to the Knowledge Bases section, and click on the option to create a new knowledge base. After that, you’ll need to give it a name and select a data source. For this, go with the “URL” option, which allows you to import data directly from your website or repository.
Now, here’s the fun part—deciding how deep you want your web crawler to go. You can choose to have it crawl just the specific URL, or you can let it dive deeper into the entire path, all the linked pages, or even across subdomains. For the best results, pick the “Subdomains” option. This way, your agent will have access to a wider range of content, making it smarter and more capable. Also, you can decide if you want to index embedded media. So, if you need images, videos, or other media to be included in the training, you can easily add those too.
Once you’ve got your settings all set, it’s time to choose an embedding model. This model will determine how the content is processed and understood by your AI. After picking the model that works best for you, hit the “Create Knowledge Base” button, and you’re almost there!
With your knowledge base set up, the next step is to build the AI agent itself. Go back to the Caasify Cloud Server platform, click on the option to create a new agent, and give your agent a unique name. This is where you define exactly what you want the agent to do. Let’s say you want it to check for grammar—here’s an example of what your prompt could look like:
Your task is to check for grammatical errors in an article. Use the knowledge base to learn the writing style and make sure to check the following:– Look for typos, punctuation errors, and incorrect sentence structures.– Use active voice and avoid passive constructions where possible.– Check for H tags and trailing spaces.
Once your prompt is ready, it’s time to choose a model for the agent. For this example, we’re using the Claude 3.5 Sonnet model, but you can pick any model that suits your needs. After that, link the knowledge base you created earlier to the agent, and then click “Create Agent.” And boom, the magic begins! The deployment process might take a few minutes, but don’t worry—that’s all part of the plan.
Once the agent is up and running, you can test it out in the Playground. Just paste a markdown file with some intentional grammatical errors and structural issues into the agent’s interface and watch as it works its magic. The agent will analyze the content, find the issues, and suggest improvements based on the criteria you set up. Congratulations! You’ve now completed the first and most important step in building your AI agent. With this powerful tool at your fingertips, you can automatically review your markdown files, save tons of time, and make sure your content always matches your team’s writing style and standards. No more manual reviews—just a smart, AI-powered assistant working behind the scenes to make sure your documents are spot-on.
Important: After creating the knowledge base and agent, the next steps involve ensuring that the correct model is chosen based on your needs. Always test the agent to confirm its effectiveness in real-world scenarios.
Using the GitHub Action
So, you’ve got your AI agent set up—awesome! But now, the fun part begins: integrating that AI-powered genius into your GitHub repository. This is where all the magic happens. In this step, we’re going to make sure everything is set up so your AI agent can jump in and start reviewing your markdown files for grammar and style issues automatically. Let’s break it down:
- Copy the Agent Endpoint and Create a Key
First things first—let’s grab the endpoint of your AI agent. You’ll find this in your Caasify Cloud Server platform. Then, head to the Settings tab and create a new key. Now, this key is important. You’ll need to store it safely because it’s like the secret password that lets your GitHub Action communicate with the AI agent. Without it, the AI can’t do its job. So, treat it like a VIP pass—keep it secure!
- Add the Endpoint and Key to Your Repository Settings
Alright, now we’re going to tell GitHub where to find your AI agent. Go to the repository where you want to use the GitHub Action. Inside the repository, navigate to the Settings tab. Under the “Actions” section, you’ll see an option to add the agent’s endpoint and API key. This is what connects your GitHub Action with the AI. Once you’ve linked these, your action will be able to talk to the AI agent and start performing automated grammar checks.
- Create a Workflow File in the Repository
Now comes the fun part—creating the workflow that will run everything. In your repository, head to the workflow folder and create a new .yml file (for example, .github/workflows/grammar-check.yml ). This is where you’ll define the instructions for your GitHub Action. Here’s an example of what the configuration could look like:
name: Check Markdown Grammar on: pull_request: types: [opened, synchronize, reopened] paths: – ‘**/*.md’ workflow_dispatch: jobs: check-markdown: runs-on: ubuntu-latest steps: – uses: actions/checkout@v3 with: fetch-depth: 0 – name: Get changed files id: changed-files uses: dorny/paths-filter@v2 with: filters: | markdown: – ‘**/*.md’ – ‘!**/node_modules/**’ – name: Check Markdown Grammar if: steps.changed-files.outputs.markdown == ‘true’ uses: Haimantika/[email protected] with: do-api-token: ${{ secrets.DO_API_TOKEN }} do-agent-base-url: ${{ secrets.DO_AGENT_BASE_URL }} file-pattern: ${{ steps.changed-files.outputs.files_markdown }} exclude-pattern: ‘**/node_modules/**,**/vendor/**’
This YAML file is like the recipe for your GitHub Action. It tells GitHub to check for any changes in markdown files ( **/*.md ) whenever a pull request is made or updated. Then, it runs the grammar check by calling the AI agent and analyzing those files for grammar or style issues.
Test the Action
Okay, so you’ve done all the hard work—now it’s time for a test drive! To see the action in action, create a pull request with a markdown file in your repository. As soon as that pull request is made, the GitHub Action will spring to life and automatically execute the grammar check process. If the AI detects any issues, the action will fail, pointing out exactly what needs fixing. But if everything looks good, it’ll pass the test, and your file will be ready to merge.
By following these steps, you’ve just set up a super-efficient, AI-powered grammar check that runs automatically every time you make a pull request. This not only saves you time but also ensures that your markdown files are always on point—no more manually checking documents or worrying about missing small errors. It’s all automated, and all you have to do is let the AI do its thing!
GitHub Actions: Automating CI/CD
Using the GitHub Action
So, you’ve got your AI agent set up—awesome! But now, the fun part begins: integrating that AI-powered genius into your GitHub repository. This is where all the magic happens. In this step, we’re going to make sure everything is set up so your AI agent can jump in and start reviewing your markdown files for grammar and style issues automatically. Let’s break it down:
- Copy the Agent Endpoint and Create a Key
First things first—let’s grab the endpoint of your AI agent. You’ll find this in your Caasify Cloud Server platform. Then, head to the Settings tab and create a new key. Now, this key is important. You’ll need to store it safely because it’s like the secret password that lets your GitHub Action communicate with the AI agent. Without it, the AI can’t do its job. So, treat it like a VIP pass—keep it secure!
- Add the Endpoint and Key to Your Repository Settings
Alright, now we’re going to tell GitHub where to find your AI agent. Go to the repository where you want to use the GitHub Action. Inside the repository, navigate to the Settings tab. Under the “Actions” section, you’ll see an option to add the agent’s endpoint and API key. This is what connects your GitHub Action with the AI. Once you’ve linked these, your action will be able to talk to the AI agent and start performing automated grammar checks.
- Create a Workflow File in the Repository
Now comes the fun part—creating the workflow that will run everything. In your repository, head to the workflow folder and create a new .yml file (for example, .github/workflows/grammar-check.yml ). This is where you’ll define the instructions for your GitHub Action. Here’s an example of what the configuration could look like:
name: Check Markdown Grammar on: pull_request: types: [opened, synchronize, reopened] paths: – ‘**/*.md’ workflow_dispatch: jobs: check-markdown: runs-on: ubuntu-latest steps: – uses: actions/checkout@v3 with: fetch-depth: 0 – name: Get changed files id: changed-files uses: dorny/paths-filter@v2 with: filters: | markdown: – ‘**/*.md’ – ‘!**/node_modules/**’ – name: Check Markdown Grammar if: steps.changed-files.outputs.markdown == ‘true’ uses: Haimantika/[email protected] with: do-api-token: ${{ secrets.DO_API_TOKEN }} do-agent-base-url: ${{ secrets.DO_AGENT_BASE_URL }} file-pattern: ${{ steps.changed-files.outputs.files_markdown }} exclude-pattern: ‘**/node_modules/**,**/vendor/**’
This YAML file is like the recipe for your GitHub Action. It tells GitHub to check for any changes in markdown files ( **/*.md ) whenever a pull request is made or updated. Then, it runs the grammar check by calling the AI agent and analyzing those files for grammar or style issues.
Test the Action
Okay, so you’ve done all the hard work—now it’s time for a test drive! To see the action in action, create a pull request with a markdown file in your repository. As soon as that pull request is made, the GitHub Action will spring to life and automatically execute the grammar check process. If the AI detects any issues, the action will fail, pointing out exactly what needs fixing. But if everything looks good, it’ll pass the test, and your file will be ready to merge.
By following these steps, you’ve just set up a super-efficient, AI-powered grammar check that runs automatically every time you make a pull request. This not only saves you time but also ensures that your markdown files are always on point—no more manually checking documents or worrying about missing small errors. It’s all automated, and all you have to do is let the AI do its thing!
JetBrains Guide to GitHub Actions
Making the Action Ready to Be Used by the Community
You’ve just built your GitHub Action, and now it’s time to share it with the world! But before you open it up to the community, there’s one important step: testing it locally to make sure everything works just as you expect. This phase is like the dress rehearsal before the big show—it’s your chance to catch any issues and make sure everything is running smoothly. So, let’s dive in and get it ready for prime time.
First things first, you’ll want to create an action.yml file. This file acts as the blueprint for your GitHub Action, providing all the essential details, like its name, description, and how it should run. Think of it as your action’s resume, letting anyone who comes across it know exactly what it does. Here’s what it might look like:
name: ‘Markdown Grammar Checker’
description: ‘Checks markdown files for grammar, style, and formatting issues using AI’
author: ‘Your Name’
inputs:
github-token:
description: ‘GitHub token for accessing PR files’
required: true
default: ${{ github.token }}
do-api-token:
description: ‘Caasify API token’
required: true
do-agent-base-url:
description: ‘Caasify AI agent base URL’
required: true
file-pattern:
description: ‘Glob pattern for files to check’
required: false
default: ‘**/*.md’
exclude-pattern:
description: ‘Glob pattern for files to exclude’
required: false
default: ‘**/node_modules/**’
runs:
using: ‘node16’
main: ‘index.js’
branding:
icon: ‘book’
color: ‘blue’
In this action.yml file, you’re laying out the action’s metadata. It’s telling GitHub that your action is a “Markdown Grammar Checker” and what kind of inputs it needs—like the GitHub token for accessing pull requests and the API token for your Caasify AI agent. It also sets up which files to check and which ones to skip, like the ones in node_modules.
Now, you’re not quite done yet—let’s write the logic that makes this action tick. For that, you’ll need to create an index.js file. This file will handle everything, from interacting with the GitHub API to running the grammar checks using the AI agent. The index.js file is the brain behind the operation.
Apart from the index.js file, you’ll also create a package.json file. This will hold all the dependencies and scripts required to run your action. You’re basically giving GitHub everything it needs to execute your action without any hiccups.
Once you’ve tested everything and confirmed that it works as expected, it’s time to make your action available to the community. You’ll create a release and publish it on the GitHub Marketplace, where anyone can find and use it in their own repositories. But you’re not done just yet—let’s make sure users can easily integrate your action into their workflows.
Here’s an example of what users will need to add to their workflow file to use your action:
name: Check Markdown Grammar
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
– ‘**/*.md’
workflow_dispatch:
jobs:
check-markdown:
runs-on: ubuntu-latest
steps:
– uses: actions/checkout@v3
with:
fetch-depth: 0
– name: Get changed files
id: changed-files
uses: dorny/paths-filter@v2
with:
filters: |
markdown:
– ‘**/*.md’
– ‘!**/node_modules/**’
– name: Check Markdown Grammar
if: steps.changed-files.outputs.markdown == ‘true’
uses: Haimantika/[email protected]
with:
do-api-token: ${{ secrets.DO_API_TOKEN }}
do-agent-base-url: ${{ secrets.DO_AGENT_BASE_URL }}
file-pattern: ${{ steps.changed-files.outputs.files_markdown }}
exclude-pattern: ‘**/node_modules/**,**/vendor/**’
This configuration allows users to automatically run grammar and style checks on markdown files every time a pull request is opened, synchronized, or reopened. It’s like putting the grammar check on autopilot! If the action detects any issues, it will fail, pointing out what needs fixing. If there are no issues, it passes, and the file is ready to be merged.
And that’s it! You’ve now created a fully functional GitHub Action that can be shared with the world. By following these steps, you’ve made it possible to automate the tedious process of reviewing markdown files, ensuring your content stays polished, professional, and in line with your team’s writing style. Now you can focus on more important things, knowing your action is working behind the scenes to keep everything error-free.
Remember to test your action thoroughly before releasing it to ensure that everything works smoothly for users.
If you want more details on how to create GitHub Actions, check out the documentation for additional insights.
Conclusion
In conclusion, integrating an AI-powered GitHub Action with the Gradient platform offers a powerful solution to streamline the technical writing review process. By automating grammar and style checks, this tool significantly reduces the manual effort required, saving valuable time and ensuring consistency across your projects. With the ability to customize and share your GitHub Action, you can easily integrate it into repositories for seamless pull request reviews. As AI technology continues to evolve, we can expect even more sophisticated tools that will further enhance the efficiency of code and content reviews.This integration of AI and GitHub offers a glimpse into the future of automated workflows, where AI not only improves writing quality but also drives productivity in development environments.
Master CI CD Setup with GitHub Actions and Snyk in Cloud (2025)