You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Apollo Schema Check Action
v1.0.0
A GitHub Action to run a schema check using the Apollo CLI and Apollo Studio (formerly Graph Manager) and post the results as a comment on a Pull Request
Create a file in your repo named .github/workflows/schema_check.yml
with the following contents:
name: Schema Check
on:
pull_request:
types: ['opened', 'reopened', 'synchronize']
jobs:
check schema:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- name: Customer API check
uses: iansu/apollo-schema-check-action@v1
with:
title: Customer API
graph: my-customer-api
variant: production
localSchemaFile: 'schema.graphql'
serviceName: my-service
validationPeriod: P2W
key: ${{ secrets.APOLLO_KEY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Almost all of the settings from the Apollo CLI schema:check
command are supported, with the following differences:
- The
json
andmarkdown
options have been removed because this action requires markdown to post a comment on your PR - The
header
option works slightly different, you pass it a comma separated list of headers. For example:Header1=Value,Header2=Value2
.
Some additional settings have also been added:
Name | Description | Default | Required |
---|---|---|---|
title | The name of the graph which will be shown in the comment | No | |
alwaysComment | Leave a comment on the PR even if there are no schema changes in the PR | false | No |
failOnError | Fail the check if breaking changes or composition errors are found | true | No |
Made with 🥃 by Ian Sutherland (@iansu). This project is released under the MIT license.