What the agent does
The agent clones the repository into its own cloud sandbox and reads what the app already knows how to check before it writes a workflow. In an app generated from thecodingmachine/react-native-boilerplate, package.json is on React Native 0.84.0 and React 19.2.3 with TypeScript, Jest 30 on the react-native preset, ESLint 9 as a flat eslint.config.mjs that stacks typescript-eslint strict type-checked rules, unicorn, perfectionist and the React plugins, and Prettier. The scripts are already split the way CI wants them: lint:rules, lint:code-format, lint:type-check and test, with lint chaining the first three. engines.node asks for 22.11 or newer, packageManager pins Yarn 1.22.22 and the lockfile is a v1 yarn.lock. There is no .github/ directory, so nothing runs on a pull request today.
Two details in the test setup would fail a workflow written blind. test:report calls jest --ci --reporters=jest-junit, but jest-junit is not in devDependencies, so the agent adds it rather than silently dropping the junit output. jest.config.js collects coverage from src/Components/**, while the components live under src/components (atoms, molecules, organisms, templates) and the three existing tests are Skeleton.test.tsx, ThemeProvider.test.tsx and Example.test.tsx; the agent fixes the glob so the coverage table the workflow prints is not empty. jest.setup.js already imports the mocks under src/tests/__mocks__, so no new mocking is needed for CI.
It writes .github/workflows/ci.yml on pull_request and on push to main, with permissions: contents: read and a concurrency group keyed on the ref with cancel-in-progress, so a second push to the same branch stops the first run. A checks job on ubuntu-latest uses actions/setup-node with Node 22 and cache: yarn, installs with yarn install --frozen-lockfile, then runs yarn lint:rules, yarn lint:code-format, yarn lint:type-check and yarn test:report, and uploads junit.xml and the coverage/ directory as artifacts. A second android job installs Temurin JDK 17, sets up Gradle caching, and runs ./gradlew assembleDebug in android/, which the repository's build.gradle pins to compileSdk 35, minSdk 24, Kotlin 2.1.20 and the Gradle 9.0 wrapper; it uploads the debug APK. No iOS job is added, because it needs a macOS runner and a CocoaPods install, and the pull request says so.
In the sandbox the agent runs exactly the checks commands on Node 22 to see them pass before the workflow does, runs actionlint on the new file, and checks that yarn install --frozen-lockfile leaves yarn.lock untouched after the jest-junit addition is locked in. It then opens the pull request, whose own checks are the first real run of the workflow.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "Add GitHub Actions CI to this React Native app. Read package.json, jest.config.js, jest.setup.js, eslint.config.mjs and android/build.gradle first. Write .github/workflows/ci.yml that runs on pull requests and pushes to main with a concurrency group and read-only permissions: one job on Node 22 with Yarn caching that installs with a frozen lockfile and runs lint:rules, lint:code-format, lint:type-check and the junit test script, uploading the junit file and coverage as artifacts, and one job that builds the Android debug APK with JDK 17 and Gradle caching. Fix anything the scripts need that is missing, such as the jest-junit dependency or a wrong coverage glob. Run the check commands and actionlint in your sandbox, then open a pull request.",
"resources": [
{
"url": "https://github.com/your-org/your-app"
}
]
}- 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.
- 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.
- 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
What comes back is a pull request on its own branch that adds .github/workflows/ci.yml and changes package.json, yarn.lock and jest.config.js. The description explains each job and why the iOS build is left out, lists the two fixes to the test setup with the lines they touch, and pastes the ESLint, Prettier, tsc and Jest output from the sandbox.
The pull request's own checks are the proof: the checks job and the android job run on it, and a reviewer sees them pass or fail on the pull request itself rather than in a description. The run's record keeps the sandbox commands with their output and the actionlint result beside the diff.
Before merging, a reviewer decides whether the Android job should run on every pull request or only when android/, package.json or yarn.lock change, whether to add branch protection that requires the checks job, and when to add a macOS job for the iOS build.
Run it on every new repository
Start one run per app without CI from your own server: POST /o/{org}/sessions with this prompt and that repository in resources, one call each. GET /o/{org}/github lists every repository the Rush GitHub App installation reaches, so a script can pick the React Native apps that have no .github/workflows/ directory and start a run for each, in its own sandbox and on its own branch.
Give the key a webhook_url and each run posts run.completed with its session_url when the turn finishes, so the pull request links collect on your side without polling. A key may have at most max_concurrent runs in progress at once, 4 by default; starting one more is accepted with 202 and status: "queued", so a script over many React Native repositories needs no waiting loop, and each queued run starts as an earlier one finishes.
The use case this job follows, with its automation and trigger: Hand off a long task.
Why run it on Rush?
A React Native workflow written without running it tends to fail on the first push: a script that names a reporter nobody installed, a Yarn version mismatch between packageManager and the runner's cache, a Gradle job without a JDK, or a coverage glob that matches nothing. The agent reads the scripts and the Android build files, runs the check commands on the right Node version in its own sandbox, and lints the workflow before anyone's pull request waits on it.
The sandbox keeps every command and its output in the run's record, so the reviewer reads the real ESLint and Jest output, not a summary. Many apps can be given the same workflow at once, each in its own sandbox with its own pull request, and the workflow's first real run is the pull request's own checks.
Frequently asked questions
Does it work with Yarn 1 and a frozen lockfile?
Yes. The boilerplate pins Yarn 1.22.22 in packageManager and ships a v1 yarn.lock, so the workflow installs with yarn install --frozen-lockfile, which fails if the lockfile would change. actions/setup-node with cache: yarn caches the Yarn cache between runs.
Why is there no iOS job?
An iOS build needs a macOS runner, a CocoaPods install from the Gemfile and Xcode, which costs more and runs longer than the rest of the workflow. The pull request names it as the next step, and the Android debug build already proves the native side compiles with the pinned SDK, NDK and Kotlin versions.
Will the Android job slow down every pull request?
It runs as a separate job, so lint and tests report on their own without waiting for Gradle, and Gradle caching keeps the build warm between runs. If you want it only when native files change, the pull request's description shows the paths filter to add.
What does the agent change outside the workflow file?
Only what the workflow needs: jest-junit is added as a dev dependency because test:report already names it, and the coverage glob in jest.config.js is fixed to match the real src/components folder. Production code and the existing tests are not touched.
More React Native jobs
The same job on other stacks
- Set Up GitHub Actions CI for a React Router App (React Router)
- Add GitHub Actions CI to a Rocket App (Rocket)
- Add GitHub Actions CI to a Sequelize App (Sequelize)