Auditing Content with GitHub Actions

This is still a work in progress, It is functional but we are working on making it simpler. Keep an eye out for updates here.

Overview

As your site content begins to scale, keeping older content up to date can become difficult.

This guide contains instructions to setup a GitHub Actions Workflow to check for outdated content using AI and raise GitHub Issues.

TinaCloud

  • Your content will be queried in TinaCloud. This supplies the GitHub action with the list of files it will need to locate.

GitHub Actions

  • The GitHub Action will use the response from TinaCloud to locate the correct files within your repository. From there the content of each file wil be read for review.

Issues
  • After scanning your content the GitHub action will produce a list of issues with suggested improvements based on your system prompt.

Pull Requests
  • The GitHub action will automatically create Pull Requests with the list of files that were checked.

GitHub Models

  • GitHub Models will read and evaluate your content, flagging any potential areas for improvement.

Installing the GitHub action

We have a public repo with a GitHub action you can use out of the box for auditing your content. Follow the installation steps to set it up.

Configuring your Repo

Permissions

Enabling Permissions for GitHub Actions

  1. Go to: Your Repository | ⚙️ Settings | Actions | General | Workflow Permissions
  2. Enable read permissions for workflows within your repository
  3. Allow GitHub Actions to create and approve pull requests

Figure: Workflow Permission Settings on GitHub

Enable GitHub Models for your repo:

  1. Go to: Your Repository | ⚙️Settings | Models
  2. Ensure you have Models enabled for your repository

Figure: Enabling GitHub Models for your Repo

Variables

You'll need to add configuration settings that will be used when the GitHub action is run. To configure the settings go to Your Repo | ⚙️Settings | Secrets and Variables.

Secrets

REQUIRED
​T​I​N​A_​T​O​K​E​N

Your TinaCloud API Token. TinaCloud | <your-project> | Tokens | Content (Readonly)


REQUIRED
​T​I​N​A_​C​L​I​E​N​T_​I​D

The TinaCMS Client ID for your project. You can find it in TinaCloud | Projects | <your-project> | ⚙️ Project Details | Client ID

All properties marked as REQUIRED must be specified for the field to work properly.

Variables

REQUIRED
​T​I​N​A_​A​U​D​I​T​O​R_​C​O​N​T​E​N​T_​W​I​N​D​O​W

A number indicating how many outdated content items will be checked when you run the action. (e.g. 5)


REQUIRED
​T​I​N​A_​A​U​D​I​T​O​R_​E​X​P​I​R​Y_​D​A​Y​S

The number of days that will pass before your content is re-evaluated being checked.


​T​I​N​A_​A​U​D​I​T​O​R_​S​Y​S​T​E​M_​P​R​O​M​P​T

The prompt that will be used to evaluate your content when passing it to GitHub model.


REQUIRED
​T​I​N​A_​A​U​D​I​T​O​R_​C​O​L​L​E​C​T​I​O​N

The collection the audit query will be ran against.

All properties marked as REQUIRED must be specified for the field to work properly.

System Prompt (Optional)

You may optionally override the default system prompt by providing your own as a GitHub variable. The value to override is TINA_AUDITOR_SYSTEM_PROMPT.

The default system prompt is as follows:

Preparing your Content

TinaCloud will be used to locate and filter your content. We'll need add a couple of fields to your selected collection to enable the content checks.

Be sure to regenerate and commit your tina-lock.json after adding the new field.

In order for the script to run we need to seed all of you existing content with a lastChecked field.

Navigate to the directory for the workflow.

You'll need to add a .env file inside this location with your Collection, TinaCMS Token and TinaCMS Client ID saved. These are the same properties added to your GitHub Settings.

Then run the commands below to migrate your content.

The output should look something like this:

You must commit and push the updated files for the GitHub action to work. The changes should be in TinaCloud.

Running the Query

Once you've finished setting up the GitHub action for your own project you should be able to see a new workflow called Audit Content with AI in the GitHub Actions for your repo. Run it to perform your first content audit.

Figure: Running a Content Audit in GitHub

The flow will output a list of Issues after the content audit is finished. Each Issue will contain a list of suggestions for the content and a handy link to the file that needs to be changed.Figure: Issue List after Running Content Audit Action The workflow will also output a pull request to update the lastChecked date of every file that was audited.

Figure: Pull Request with Last Checked Date Updated

It's important that you merge this pull request before running the GitHub Action again. Otherwise it will audit the same files again when you re-run it.

Suggestion: Assigning Issues to Copilot

Now that you have a set of Issues generated from the Workflow, you have a couple of options for tackling the feedback. You can do the Issues yourself or fully automate the process by assigning the Issue to GitHub Copilot!

Last Edited: December 12, 2025