Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Update github-integration.md #596

Merged
merged 3 commits into from
Oct 31, 2023
Merged
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 .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module.exports = {
PublishPQMs: 'readonly',
RegisterCLI: 'readonly',
RegisterFederatedCLI: 'readonly',
SetApolloVCSCommit: 'readonly',
TopLevelAwait: 'readonly'
},
rules: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,25 @@
title: Connecting Apollo Studio to GitHub
---

To enhance the convenience and helpfulness of [schema checks](./schema-checks/), the Apollo Studio app for GitHub adds links to schema check results on the pull requests that initiate them:
To enhance the convenience and helpfulness of [schema checks](./schema-checks/), the [Apollo Studio app for GitHub](https://github.com/marketplace/apollo-studio) adds links to schema check results on the pull requests that initiate them:

<img class="screenshot" src="../img/integrations/github-integration.jpg" alt="GitHub status view" width="500" />
<img
className="screenshot"
src="../img/integrations/github-integration.jpg"
alt="GitHub status view"
width="500"
/>

## Install the GitHub application

Go to [https://github.com/marketplace/apollo-studio#pricing-and-setup](https://github.com/marketplace/apollo-studio#pricing-and-setup) and click **Install it for free** to add the app to the GitHub profile or organization that you want to set up checks for.

## Configure Rover

If you haven't already, [install the Rover CLI](/rover/getting-started/) in your development environment and [authenticate it with GraphOS](/rover/configuring/#authenticating-with-graphos).

<SetApolloVCSCommit />

## Run a check on each commit

Next, make sure your CI configuration includes a step to execute schema checks. You do this by adding the `rover subgraph check` command directly as a step in your CI.
Expand Down
1 change: 1 addition & 0 deletions src/content/shared/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export {default as PQSecurityLevels} from './pq-security-levels.mdx';
export {default as PublishPQMs} from './publish-pqms.mdx';
export {default as RegisterCLI} from './register-cli.mdx';
export {default as RegisterFederatedCLI} from './register-federated-cli.mdx';
export {default as SetApolloVCSCommit} from './set-apollo-vcs-commit.mdx';
export {default as TopLevelAwait} from './top-level-await.mdx';
6 changes: 6 additions & 0 deletions src/content/shared/set-apollo-vcs-commit.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
To display schema check results on pull requests correctly, you need to make sure Rover associates the schema check execution with the pull request's `HEAD` commit, as opposed to the _merge_ commit that GitHub adds. To guarantee this, set the `APOLLO_VCS_COMMIT` environment variable in your action's configuration, like so:
Meschreiber marked this conversation as resolved.
Show resolved Hide resolved

```yaml
env:
APOLLO_VCS_COMMIT: ${{ github.event.pull_request.head.sha }}
```