Publish changes to GitHub

Turn an approved opportunity into a small pull request that changes a page title or description, then track its deployment and results.

Relay can change the title, the description, or both, of a page in your Next.js App Router site. It opens one small pull request for each approved change. You review and merge it. Relay never merges or deploys.

Connect a repository

The GitHub App is the recommended way. You choose the repositories it can reach, and Relay uses a short-lived token for each step and stores no token:

  1. Open your project, then Project settings → Integrations → GitHub publishing.
  2. Click Install GitHub App and choose the repository on GitHub.
  3. Back in Relay, click Choose a repository from the App, pick it, and connect.

If you uninstall the App, Relay shows "Reconnect the GitHub App" and writes nothing.

You can also connect with a personal access token:

  1. Open your project, then Project settings → Integrations → GitHub publishing.
  2. Create a fine-grained personal access token for this repository only. Give it these permissions:
    • Contents: Read and write and Pull requests: Read and write. Relay needs these to open the pull request.
    • Deployments: Read, Checks: Read and Commit statuses: Read. These are optional and read-only. Relay uses them to show deployment and check status.
    • Issues: Read and write is optional. Relay uses it to create issues from approved tickets.
  3. Enter the repository owner, name, base branch and root directory, for example apps/www in a monorepo.
  4. Set the GitHub production environment. This is the deployment environment that counts as production, for example Production.

Who approves the pull request

Owners always approve. Other members approve only when an owner allows it, for the whole organization or for one project. See Who can approve pull requests.

Which pages Relay can change

Relay changes a page when its metadata is literal text in one of these forms:

  • An object: export const metadata = { title: 'About us', description: '…' }.
  • A helper call: export const metadata = pageMetadata('About us', '…', '/about'). The helper must be a named import from a relative path or a tsconfig.json path alias. It must return title and description straight from its parameters.

Route groups such as app/(site)/about/page.tsx work.

Relay does not change these. It tells you why:

  • Dynamic routes such as app/[slug]/page.tsx.
  • generateMetadata.
  • Computed text.
  • Client components.

Relay changes the plain <title> and <meta name="description"> in a Pages Router page's own next/head too.

Titles

Next.js adds the nearest layout's title.template to a page title. For example, the template %s | Example makes the title "Pricing" into "Pricing | Example". Relay reads up to 3 layouts. It shows the final title before you approve. The final title must have 10 to 60 characters.

Find the page file

When you open an approved opportunity, Relay looks for its page file in the App Router app/ or src/app/ directory, including route groups. It reads folder lists only, not file contents. When it finds exactly one file, it fills in the path. You can still change it.

Relay does not find files for dynamic routes or rewrites. Enter the path yourself, or create a GitHub issue instead.

Draft a description with AI

Click Draft with AI to get a description that you can edit. Relay writes the draft from these inputs only:

  • The page's Search Console queries.
  • The live page: its title and the first 2,000 characters of its text.
  • The Business overview, Positioning and Writing preferences sections of your project context.
  • The current description in the file, when you entered the file path.

Relay checks each draft before you see it:

  1. The description has 70 to 160 characters.
  2. It has no control characters.
  3. It is different from the current description.
  4. Each number in it is in the inputs.
  5. Each claim has an exact quote from its source.
  6. Phrases such as "best", "#1" or "guaranteed" are only allowed when your project context or your current description uses them. Text on the page cannot permit them.
  7. Each query it used is a real query for the page.

When a draft fails a check, Relay tries once more. When the second draft fails too, Relay shows "Relay could not write a safe draft. Write the description yourself." It never shows a draft that failed.

Each draft shows its character count, the reason for the wording, the queries it used, and each claim with the quote that supports it. Click Use this draft to copy it into the description field. Edit it, then prepare the proposal as usual. The draft goes into your repository only after you approve the exact change.

Titles: under the title field, Draft the title with AI works the same way. The final title, with your layout's title template, must have 30 to 60 characters. When Relay can read the page file, it counts the template, and the draft leaves out the site name.

Cost and limits:

  • A draft costs about 1 to 5 credits. Relay bills the cost that the model provider reports, for both tries.
  • Drafting needs usage credits and permission to manage integrations.
  • You can draft the description 3 times and the title 3 times for each opportunity, and 30 times for each project, in 24 hours.
  • A project writes one draft at a time.

Review and approve

Each proposal shows:

  • The exact before and after text, and the file.
  • The helper, and any other place in the helper that uses the same text. Example: the Open Graph title.
  • The reason, the expected effect, the risks and the verification plan.

When you approve, Relay creates one branch, one commit and one pull request. The new text keeps your file's quote style, so formatter checks still pass. The proposal then shows Your repository's checks. This is your own CI, not a Relay build.

Track deployment and results

After you merge, open Track results for the change:

  1. Click Refresh GitHub status to confirm the merge.
  2. Click Check signals. Relay looks for two independent signals:
    • GitHub deployment: a successful deployment of the merge commit to your production environment.
    • Live page: your page shows the approved text.
  3. When both signals agree, start measurement on the verified basis. The deployment time comes from GitHub. If your repository does not report deployments, confirm the deployment time yourself.

Before measurement starts, tell Relay about other changes or seasonal effects in the same period.

Canonical URL and robots

For a technical blocker, Relay can change alternates.canonical and robots: { index, follow } in a literal metadata object. These changes can remove a page from Google, so you must type the page path to confirm. The plan adds a URL Inspection check after deployment.

GitHub issues

Some fixes are not a text change. On an approved opportunity, Relay can open a GitHub issue. It shows the exact text first, and creates the issue only after you approve that text. One approval creates one issue.

Revert a change

When a result is negative, or you change your mind, open the experiment and click Prepare revert:

  1. Relay checks that the page still shows the approved text. If someone changed the page since, it stops and asks you to prepare a new proposal instead.
  2. Relay prepares the exact inverse change as a new proposal. You approve it like any other change.
  3. After the revert pull request merges and ships, confirm it on the proposal. The opportunity then shows as reverted.

On this page