All jobs

Set Up GitHub Actions CI for a Strapi App

Yes. An agent writes a GitHub Actions workflow that format-checks, builds Strapi and checks each front end on every pull request, and opens a PR with proof.

Run this on RushOpens the console with this prompt ready to send, in a Project that has your repository.

What the agent does

The agent begins with what the repository already calls a check. In a project like strapi/LaunchPad, the only workflow is deploy-demo.yaml, which fires on pushes to main and triggers a pipeline elsewhere; nothing runs on a pull request. The checks exist as prose. AGENTS.md has a Verification section: yarn check:format at the root, yarn build in strapi/, and yarn lint and yarn build in next/. A Husky pre-commit hook runs lint-staged, which only helps contributors who installed the hooks. The job is to turn that section into a workflow.

The layout decides the workflow's shape. This is not a Yarn workspace: the root, strapi/ and each of next/, astro/, nuxt/ and tanstack/ has its own package.json and yarn.lock, and Yarn is 4.5.0 through the root packageManager field with nodeLinker: node-modules. So the agent writes one job per directory, each enabling Corepack, installing in its own folder with an immutable lockfile, and caching on that folder's lockfile. The Strapi job uses Node 22, the top of the range the backend's engines field allows. Each front-end job runs the scripts that folder defines: lint and build for Next, check for Astro, typecheck for Nuxt, lint and typecheck for TanStack.

It runs every command before it writes it into YAML. In its sandbox the agent installs each folder from a clean clone and runs the checks in the order the workflow will, keeping the output. That is how it learns the things a workflow written from memory gets wrong: whether strapi build needs the .env that yarn setup normally creates, whether the postinstall script that edits package.json leaves the tree dirty, whether prettier --check passes on main today, and whether a front-end build tries to reach a Strapi server that is not there. A check that fails on the default branch is reported and left out of the required set, not papered over.

The workflow itself is plain. It triggers on pull_request and on pushes to main, sets permissions: contents: read, cancels superseded runs with a concurrency group, and gives each job a timeout. The agent validates the file with actionlint and leaves deploy-demo.yaml alone. Because a new workflow runs on the pull request that adds it, the pull request's own checks are the first real run.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "claude",
  "input": "Add a GitHub Actions workflow that checks every pull request to this Strapi project, and open a pull request. Read AGENTS.md (the Commands, Setup and Verification sections), README.md, the root package.json, .yarnrc.yml, .husky/pre-commit, every file under .github/workflows, scripts/setup.mts, strapi/package.json, strapi/.env.example and the package.json of each front-end folder first. List every check the repository documents and the directory it runs in. Enable Corepack and, from a clean clone, run each of those commands in its directory in the order CI would, keeping the output: yarn install then yarn check:format at the root; yarn install and yarn build in strapi/; and in each front-end folder its install and whichever of lint, check, typecheck and build its package.json defines. Note which need a .env copied from .env.example, which fail on the default branch today, and whether any front-end build needs a running Strapi. Then write .github/workflows/ci.yml: on pull_request and on push to main; permissions contents read; a concurrency group that cancels superseded runs; one job per directory with a timeout, Node 22, Corepack, an immutable install in that directory and a dependency cache keyed on that directory's yarn.lock. Include only checks that pass on the default branch; list the failing ones in the pull request with their output and do not fix them here. If a front-end build needs Strapi, run that job without the build step and say so. Do not edit deploy-demo.yaml, do not add secrets, and do not change application code. Validate the workflow with actionlint. In the pull request give a table of job, directory, commands and the result of each command in the sandbox.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
  1. Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
  2. Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
  3. Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

What comes back

The pull request adds one file, .github/workflows/ci.yml. Its description has a table with a row per job: the directory, the commands, and what each command reported when the agent ran it from a clean clone. Under the table is a list of checks it left out because they fail on main today, each with the failing output, so turning them on later is a matter of fixing the cause and adding a line.

The checks on the pull request are the proof that matters. GitHub runs the new workflow on the pull request that introduces it, so before anyone reviews the YAML they can see each job's result and duration on the pull request itself. If a job that passed in the sandbox fails on GitHub's runner, the difference is usually an environment file or a Node version, and the table gives the sandbox side to compare against.

A reviewer checks that installs use the lockfile without modifying it, that no job has write permissions or reads a secret, and that the cache key is per directory, since six lockfiles sharing one key would restore the wrong dependencies. Then decide which jobs to mark as required in the branch rules. The agent does not change repository settings, so that step stays with a maintainer.

Run it on every Linear issue labelled ci

Teams that plan in Linear can start this from the issue. Connect Linear in the console under Settings → Connections, then add an automation to the Project that holds the repository with a linear trigger on linear.issue.labeled, ci in its labels, and this page's request as the prompt. When a person in your Rush org adds the label, a run starts with the issue placed after the prompt; a label added by an app integration starts nothing. The trigger fills in no placeholder, so the prompt has to stand on its own and the issue adds detail, such as a front end to leave out.

The same automation handles the follow-on work one issue at a time: add the Strapi test job once a suite exists, add a job for a fifth front end, make the format check required. For several repositories at once, a script sends the body to POST /o/{org}/sessions per repository with a request_id that is a UUID v5 of the repository's full name and the word ci, so a second run of the script starts nothing new.

The use case this job follows, with its automation and trigger: Turn a Linear label into a PR.

Why run it on Rush?

A CI workflow is easy to write and tedious to get right, because the only way to test it is to push and wait. People write the YAML from memory, open a pull request, read a red job, guess, and push again. Each round takes minutes and leaves a commit called fix ci. For a repository with six separate installs the rounds add up, and the usual shortcut is one job that installs only the backend.

The agent shortens the loop by running the commands where it can see them. In its own sandbox it does the six clean installs and every check before any YAML exists, so the workflow is built from commands that have already passed, and the ones that do not pass are known in advance. All of that output is kept in the run's transcript. The work also suits a hand-off: it is slow, it needs no judgement while it runs, and it comes back as one file plus a table you can check against the pull request's own status.

Frequently asked questions

Does it start Strapi or a database in CI?

Not for this workflow. strapi build compiles the server and the admin panel and needs no running database, and the default client is SQLite in any case. If a front-end build turns out to need a live API, the agent leaves that build out and says so. A job that boots Strapi with seeded data can be added later as a separate change.

Why one job per folder and not a single job?

Each folder has its own lockfile and nothing is shared between them, so separate jobs run in parallel and a failure names the folder it belongs to. A single job would install six times in sequence and stop at the first failure. With path filters you can go further and skip jobs for folders a pull request does not touch; ask for that in the prompt.

Will it fix formatting or lint errors it finds?

No. The request says to include only checks that pass on the default branch and to list the rest with their output. Mixing a repository-wide Prettier run into the pull request that adds CI makes both harder to review. Start a second run for the fixes and then enable the check.

Does it work with npm or pnpm instead of Yarn?

Yes. The agent reads the packageManager field and the lockfiles and writes the matching install command and cache settings: npm ci with package-lock.json, or pnpm with a frozen lockfile. Nothing in the approach is specific to Yarn.

Can the agent see whether the workflow passed on GitHub?

The pull request shows it. The agent's own evidence is the sandbox run of each command, which it reports in the table. If a job fails on GitHub, send the failing log as a follow-up message to the same session and the sandbox wakes with the repository as it left it.

More Strapi jobs

The same job on other stacks

Keep reading