Set up GitHub for Workflows

Latest Dynatrace

Your Dynatrace environment can integrate with GitHub repositories using GitHub for Workflows GitHub. After this setup, you can start using GitHub for Workflows actions in your workflow to manage issues and pull requests automatically based on your monitoring data and events.

Prerequisite

You need the app-engine:apps:install permission.

Steps

Step 1 Install GitHub for Workflows

To use GitHub workflow actions, you need to install GitHub for Workflows from Dynatrace Hub.

  1. In Dynatrace Hub Hub, select GitHub for Workflows.
  2. Select Install.

Step 2 Add a host to the Allow-list in Limit outbound connections

By adding the GitHub host called api.github.com to the Allow-list in Limit outbound connections, you can granularly control the web services connected to your Dynatrace environment.

To set up the connection between GitHub and your Dynatrace environment

  1. Go to Settings > Preferences > Limit Outbound Connections.
  2. Select Add item and add api.github.com.
  3. Select Save changes.

Step 3 Grant permissions to Workflows

Aside from permissions required by Workflows to run actions on your behalf, there are additional permissions required to use GitHub for Workflows actions.

To fine-tune permissions granted to Workflows

  1. Go to Workflows and select Settings > Authorization settings.
  2. Select the following permissions besides the general Workflows permission.
    • app-settings:objects:read

For more information on general Workflows user permissions, see User permissions for workflows.

Step 4 Authorize connection to GitHub

You need to configure connections for each of your GitHub environments.

To configure a connection

  1. Create a personal access token for your GitHub account as described in Managing your personal access tokens. We only support cloud-based GitHub plans such as GitHub Enterprise Cloud. GitHub Enterprise Server plans aren't supported.

  2. Go to Settings > Dynatrace Apps > GitHub Connections.

  3. Select Add item.

  4. Define your GitHub connection.

    • Connection name: Provide a meaningful and unique name for your connection.
    • GitHub Type: Select the type of authorization mechanism.
    • GitHub token: Provide your GitHub API token.
  5. Select Save changes.

Limit your personal access token permissions

We strongly recommend that you limit the permissions of your personal access tokens to the necessary minimum. For more information, see Managing your personal access tokens for information about limiting the access to a certain repository or permissions/scopes. This ensures that your personal access token can be used for accessing and changing only the permitted repositories.