Snyk Documentation


How to integrate GitHub to test and watch your repositories

You can add your Node.js, Ruby, Python, Scala and Java GitHub repos and quickly test them, or decide which ones you’d like to continuously watch with Snyk.

This integration only works with GitHub and GitHub Enterprise instances that are publicly reachable (not on a private network) and not for For private instances, you will need to set up via Snyk’s Broker first.

add new project


  1. Go to the integrations page and click “Connect to GitHub”.
  2. You need to grant Snyk additional GitHub permissions.Choose to give access to public and private repositories, grant access to public repositories only, or monitor public repositories only (with limited functionality).
    Granting GitHub permissions
  3. Next, you’ll see a list of all GitHub repos across your GitHub organisations. Select the repos you would like to test with Snyk. If you have supported manifest files at the root, or one or two directories deep, Snyk will automatically recognise and create projects for them.
  4. Click on the button at the bottom of the page “Add selected repositories to Snyk”. The selected repos appear in your projects, and will be continuously checked for vulnerabilities.
  5. Clicking “View report” on any project lets you view & fix vulnerabilities right away. You’ll be able to review the suggested remediations, and create a PR with the required upgrades or patches.

To view your organisation's projects in Snyk, you'll need to have sufficient access to your organisation's repositories on GitHub

Why are write permissions required?
Due to the level of granularity offered by GitHub's permissions model, Snyk requires write permissions to provide several key features.

  1. Test new pull requests for new vulnerabilities.
  2. Using GitHub's webhooks to monitor the latest version of the project.
  3. And, last but not least... raising pull requests to remediate your vulnerabilities!

Integration features

Watch a Node.js, Ruby, Python, Scala or Java GitHub repo to add it as a project to Snyk. This will allow you to:

  1. see Snyk tests in your pull requests that check for vulnerabilities.
  2. get email alerts and a Snyk pull request with fixes when new vulnerabilities that affect your repo are disclosed.
  3. get email alerts and a Snyk pull request if a new upgrade or patch is available for a vulnerability that affects you.
  4. trigger a Snyk pull request with fixes yourself from the test report page or the project page for your repo on


Snyk Test on your pull requests

Snyk Test on pull requests

Snyk tests will be visible in pull requests on repos that you are watching with Snyk.

You can review and adjust the settings for this by going to the ‘Settings’ for the watched project:

Snyk Test on pull request settings

By default, Snyk runs a test when the dependencies in the package.jsonrequirements.txt or Gemfile.lock / Gemfile change, and fails the test if the new dependencies have vulnerabilities.

You can change this to fail if the repository has any existing vulnerabilities (so tests will fail even if the current PR is not adding new vulnerable dependencies).

You can choose to fail tests only for high severity vulnerabilities.

You can disable Snyk tests in pull requests.

Fix vulnerabilities with Snyk pull requests

Note: Currently for Node.js and Ruby only

When viewing a Snyk test report for a repo that you own, or when looking at a project that you are watching with Snyk, you’ll see two options for fixing a vulnerability:
1) ‘Open a fix PR’ link: generate a Snyk pull request with the minimal changes needed to fix the vulnerabilities affecting the repo.
2) ‘Fix this vulnerability’ link: generate a Snyk pull request that fixes only this vulnerability.

Fix vulnerabilities with Snyk pull requests

You can review the vulnerabilities that will be fixed, change your selection, and choose to ignore any vulnerabilities that can’t be fixed right now before opening the pull request on the ‘Open a fix PR’ page.

Note that patching is only supported for Node.js repos; Ruby vulnerabilities can be fixed with upgrades only.

Open a fix PR page

Snyk fixes your Ruby projects by updating vulnerable dependencies in your Gemfile.lock file. When a fix requires a change to your Gemfile, our fix pull requests will propose these changes.
When you open a PR via, we will give you a heads-up when this is the case:

Gemfile changes flag

Here’s an example for the pull request:

Snyk remediation PR

Get a Snyk pull request when newly disclosed vulnerabilities affect you

Whenever a vulnerability is disclosed that affects a repo you’re watching, Snyk will not only email you about it, but also generate a Snyk pull request that addresses the vulnerabilities. You’ll receive a pull request similar to the example above.

Get a Snyk pull request when new upgrades or patches are available

When no upgrade is available, you can ignore or patch the vulnerability (patching is only available for Node.js projects). When a better remediation option has become available, for example an upgrade for a vulnerability you previously ignored, Snyk notifies you about this via email, and also generates a pull request with the new fix.

Disable automatic pull requests

You can disable Snyk’s auto-generated pull requests with fixes in your organisation settings. This will affect all projects in the organisation.

Authorizing GitHub


Disabling the GitHub integration

If you don’t want to watch a GitHub repo anymore, you can stop watching this project via the project settings. The project will be set to inactive, and you’ll no longer get alerts, pull requests, or Snyk test on your pull requests. The webhook that enables the GitHub integration for this repo will be removed.
You can restart watching at any time.

GitHub organisations

To test your GitHub organisation’s repositories with Snyk, you will need to have sufficient user permissions. When you authenticate Snyk, GitHub will show you which organisations you can integrate.
If you do not have the correct permissions, you will see “Access request pending” next to your organisation’s name, and you will be unable to see this organisation’s projects in Snyk.

Adding your GH repos

If you’d like to integrate this organisation, you will need to request organisational approval in GitHub.