message: Skip CI commands that use apiKey when not present
diff: @@ -26,12 +26,12 @@ commands:
  jobs:
  # Platform tests, each with the same tests but different platform or version.
  NodeJS 8:
  - executor: { name: oss/node, tag: '8' }
  + executor: { name: oss/node, tag: "8" }
  steps:
  - common_test_steps
  NodeJS 10:
  - executor: { name: oss/node, tag: '10' }
  + executor: { name: oss/node, tag: "10" }
  steps:
  - common_test_steps
  # We will save the results of this one particular invocation to use in
  @@ -78,7 +78,14 @@ jobs:
  - oss/install_specific_npm_version
  - checkout
  - oss/npm_clean_install_with_caching
  - - run: ENGINE_API_KEY=$CHECKS_API_KEY ./packages/apollo/bin/run client:check
  + - run:
  + name:
  + command: |
  + if [ -z "$CHECKS_API_KEY" ]; then
  + echo "NO CHECKS_API_KEY! CANNOT RUN! This is normal on PRs from Forks."
  + exit 0 # i.e. pass tests.
  + fi
  + ENGINE_API_KEY=$CHECKS_API_KEY ./packages/apollo/bin/run client:check
  Generated Types Check:
  executor: { name: oss/node }
  @@ -87,11 +94,14 @@ jobs:
  - checkout
  - oss/npm_clean_install_with_caching
  - run:
  - name: Generate types locally
  - command: npx apollo client:codegen --key=$CHECKS_API_KEY --outputFlat --target=typescript currentTypes.ts
  - - run:
  - name: Compare type files
  - command: cmp --silent currentTypes.ts ./packages/apollo-language-server/src/graphqlTypes.ts || (echo "Type check failed. Run 'npm run client:codegen'" && exit 1)
  + name: Generate types locally and compare type files
  + command: |
  + if [ -z "$CHECKS_API_KEY" ]; then
  + echo "NO CHECKS_API_KEY! CANNOT RUN! This is normal on PRs from Forks."
  + exit 0 # i.e. pass tests.
  + fi
  + npx apollo client:codegen --key=$CHECKS_API_KEY --outputFlat --target=typescript currentTypes.ts
  + cmp --silent currentTypes.ts ./packages/apollo-language-server/src/graphqlTypes.ts || (echo "Type check failed. Run 'npm run client:codegen'" && exit 1)
  common_non_publish_filters: &common_non_publish_filters
  filters:
  @@ -148,4 +158,3 @@ workflows:
  <<: *common_publish_filters
  requires:
  - Confirmation
  -
  