GitHub Issues

Our GitHub Issues integration enables you to turn issues flagged in Code Climate into GitHub Issues with one quick click. For example, on your Feed page, mouse over a smell and click the "ticket" icon.

  1. In order for Code Climate to have the appropriate permissions to post to your repository's issues, a GitHub OAuth token must be generated. Browse to the following location in GitHub: https://github.com/settings/tokens.

Ensure you are logged into GitHub as a user that has access and sufficient privileges to the repository. Note that Code Climate will open the issue as the user that generates the token.

  1. Click Generate new token.

Note: GitHub may prompt for your password before allowing you to proceed.

  1. Name the token (anything you like, as long as no other GitHub token currently shares this name). Ensure that the repo scope is checked. Click Generate Token.
  1. Click the "copy to clipboard" button.
  1. In a new browser window, navigate to your Code Climate Dashboard.
  2. Mouse over your repository's name and click Settings.
  1. Select the Integrations tab.
  2. Next to GitHub Issues, click Set Up.
  1. Paste the OAuth token in the OAuth Token field.
  2. Enter the project name in the Project field. This is the project name on GitHub. For example, user/myapp.
  3. Enter any labels in the Labels field. These labels will be associated with any issues created by Code Climate.
  1. Ensure Active is checked and click Save.
  2. To verify the GitHub data is valid, click Test Service (this will post a test issue to your repository). If a green message appears at the top of the screen, all is well. If a red error message is displayed, see Troubleshooting below.

Troubleshooting

If you are seeing a red error message after clicking Test Service:

  • Ensure there are no leading or trailing spaces around the token that you provided to Code Climate.
  • Ensure you generated the token as a GitHub user that has access to the repository. If you have multiple GitHub users, double-check that you're logged into GitHub as the appropriate user.

Does Code Climate require Read/Write access to my GitHub repositories?

Code Climate requests the following GitHub permissions:

  • user:email - requested when signing up using GitHub. An email address is required to create a Code Climate user.

  • public_repo - requested when adding a public repo to Code Climate. This access allow us to install a read-only SSH key, set up a webhook, and write commit statuses to public repos.

  • repo - requested when adding a private repository to Code Climate. This access allow us to install a read-only SSH key, set up a webhook, and write commit statuses to private repos.

The repo and public_repo scopes grant read and write access to code. While we will never write code to your repository, currently these OAuth scopes are the most narrow that GitHub supports for our use case (there is no repo:read e.g.).

GitHub Integrations

We have two GitHub integrations: one for GitHub pull requests and another for GitHub Issues. Since both integrations require you to create a GitHub personal access token, ensure that the token does not have read/write access:

  • GitHub Pull Requests: The token should be generated by any user that has GitHub permissions to access the repository (it is not necessary to generate the token as a GitHub machine user). When generating the token, ensure that only the repo:status scope is selected.

  • GitHub Issues: The token should be generated by a GitHub machine user that has read-only access to the repository. When generating the token, ensure the repo scope is selected.

GitHub Issues


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.