• Products
  • Get started
  • Documentation
  • Resources

Use deployment gating with GitHub

The deployment gating feature allows you to bring change requests from GitHub to Jira Service Management for approval. Once set up, any GitHub deployments to your selected environments are automatically sent to approvers in Jira Service Management and will only deploy if approved.

Before you can use deployment gating with GitHub, you must first:

At this point, your service project is ready to connect to GitHub repositories.

Configurations in GitHub

Before you start configuring deployment gating in GitHub, make sure that Jira application is installed in your GitHub account. You can check this from Integrations > Applications in GitHub. If Jira application is not available, first add the Jira application.

  1. Log in to your GitHub and go to the repository you’d like to use as deployment gating.

  2. From the repository, navigate to Settings > Enviroments

  3. Create the environment you’d like to apply deployment gating, or select an existing one.

  4. Under Deployment protection rules, select Jira as your custom protection rule. This will make GitHub require approval from your service project.

  5. Select Save protection rules.

  6. In your .jira/config.yml file, spot deployments and update the file with the sample script provided below. If you don't have the file, go back and connect your GitHub repositories with Jira Service Management

1 2 3 4 5 6 7 8 9 10 11 deployments: deploymentGating: enabled: true # to enable the feature retry: 50 # run poll action 50 times sleep: 30 # wait 30 seconds between each poll environments: # select the environments you'd like to use with this feature - Development - Production services: ids: - b:YXJpOmNsb3VkOmdyYXBoOjpzZXJ2aWNlLzIwM2VkMWE0LTE0MmEtNDE0Yy1hYjY4LTA1OGMzMDBkODAxMS9lNDUzYzg1NC1lMTMzLTExZWUtYTRiNC0xMjhiNDI4MTk0MjQ=

Now, GitHub will halt deployments for the environments selected until it receives approval from Jira Service Management. Each time GitHub halts a deployment, the relevant change request in your service project will ask for approval from the change approver in Jira Service Management.

If the change approver approves the request, deployment on GitHub will be deployed. If the change approver declines the request, the deployment will appear as failed. A link to the relevant change requests will appear as a comment. Find out how to set up approval steps.

Additional Help