Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This is the log of notable changes to EAS CLI and related packages.

### 🎉 New features

- [eas-cli] Add `integrations:github:connect` and `integrations:github:status` to link GitHub repositories to EAS projects from the CLI. ([#4538](https://github.com/expo/eas-cli/pull/4538) by [@tchayen](https://github.com/tchayen))
- [build-tools] Record iOS Simulator sessions through serve-sim. ([#4474](https://github.com/expo/eas-cli/pull/4474) by [@gwdp](https://github.com/gwdp))
- [eas-cli] Add browser device login with resumable commands for chat agents. ([#4502](https://github.com/expo/eas-cli/pull/4502) by [@eiiot](https://github.com/eiiot))

Expand Down
49 changes: 49 additions & 0 deletions packages/eas-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ If you want to enforce the `eas-cli` version for your project, use the `"cli.ver
* [`eas integrations:convex:team`](#eas-integrationsconvexteam)
* [`eas integrations:convex:team:delete [CONVEX_TEAM]`](#eas-integrationsconvexteamdelete-convex_team)
* [`eas integrations:convex:team:invite [CONVEX_TEAM]`](#eas-integrationsconvexteaminvite-convex_team)
* [`eas integrations:github:connect`](#eas-integrationsgithubconnect)
* [`eas integrations:github:status`](#eas-integrationsgithubstatus)
* [`eas integrations:posthog:connect`](#eas-integrationsposthogconnect)
* [`eas integrations:posthog:dashboard`](#eas-integrationsposthogdashboard)
* [`eas integrations:posthog:disconnect`](#eas-integrationsposthogdisconnect)
Expand Down Expand Up @@ -2023,6 +2025,53 @@ DESCRIPTION

_See code: [packages/eas-cli/src/commands/integrations/convex/team/invite.ts](https://github.com/expo/eas-cli/blob/v24.10.0/packages/eas-cli/src/commands/integrations/convex/team/invite.ts)_

## `eas integrations:github:connect`

connect a GitHub repository to the current EAS project

```
USAGE
$ eas integrations:github:connect [--json] [--non-interactive] [--repo <value>] [--base-directory <value>]

FLAGS
--base-directory=<value> Directory containing the app in the repository (defaults to existing settings or /)
--json Enable JSON output, non-JSON messages will be printed to stderr. Implies --non-interactive.
--non-interactive Run the command in non-interactive mode.
--repo=<value> GitHub repository in owner/repo format (github.com)

DESCRIPTION
connect a GitHub repository to the current EAS project
The Expo GitHub app must already be installed and linked to the Expo account that owns the project. Authorize your
GitHub account in your Expo personal settings before running this command. Supports github.com repositories.

EXAMPLES
$ eas integrations:github:connect --repo owner/repo

$ eas integrations:github:connect --repo owner/repo --non-interactive --json

$ eas integrations:github:connect --repo owner/monorepo --base-directory apps/mobile
```

_See code: [packages/eas-cli/src/commands/integrations/github/connect.ts](https://github.com/expo/eas-cli/blob/v24.10.0/packages/eas-cli/src/commands/integrations/github/connect.ts)_

## `eas integrations:github:status`

show the GitHub repository linked to the current EAS project

```
USAGE
$ eas integrations:github:status [--json] [--non-interactive]

FLAGS
--json Enable JSON output, non-JSON messages will be printed to stderr. Implies --non-interactive.
--non-interactive Run the command in non-interactive mode.

DESCRIPTION
show the GitHub repository linked to the current EAS project
```

_See code: [packages/eas-cli/src/commands/integrations/github/status.ts](https://github.com/expo/eas-cli/blob/v24.10.0/packages/eas-cli/src/commands/integrations/github/status.ts)_

## `eas integrations:posthog:connect`

connect PostHog to your Expo project
Expand Down
34 changes: 34 additions & 0 deletions packages/eas-cli/src/commandUtils/github.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { GitHubRepositoryAppQuery } from '../graphql/generated';
import Log from '../log';
import { printJsonOnlyOutput } from '../utils/json';

export function printGitHubRepository(
app: GitHubRepositoryAppQuery['app']['byId'],
{ json }: { json: boolean }
): void {
const repository = app.githubRepository;
const fullName = repository
? `${repository.metadata.githubRepoOwnerName}/${repository.metadata.githubRepoName}`
: null;
if (json) {
printJsonOnlyOutput({
projectId: app.id,
projectFullName: app.fullName,
connected: !!repository,
repository: repository
? {
id: repository.id,
fullName,
url: repository.metadata.githubRepoUrl,
githubRepositoryIdentifier: repository.githubRepositoryIdentifier,
}
: null,
baseDirectory: app.githubRepositorySettings?.baseDirectory ?? null,
});
} else if (repository) {
Log.log(`${app.fullName} is connected to ${fullName}.`);
Log.log(`Base directory: ${app.githubRepositorySettings?.baseDirectory ?? '(not configured)'}`);
} else {
Log.log(`${app.fullName} is not connected to a GitHub repository.`);
}
}
Loading
Loading