Skip to main content

GitHub Teams + Indent Webhook

This guide will show you how to deploy a webhook for Indent to communicate with GitHub Teams for a single organization. This webhook can be run as a Google Cloud Function.

There are direct code examples in the indentapis/examples repository. Take a look at the code that will run in these webhooks: terraform-gcloud-github-teams-pull-webhook and terraform-gcloud-github-teams-webhook.

This page assumes that you or someone on your team has already completed the Quickstart. If you haven't already, we would recommend you check it out - it should take 5 minutes.

One-minute demo#

Under 10-minute walkthrough#

Prerequisites

Overview

We're going to pull GitHub Teams into Indent (optionally, you can import teams manually) then set up automated change management. This webhook can be deployed as a Google Cloud Function.

Step 0: Configure your cloud provider#

Before getting started, let's get all the Google Cloud-specific items ready:

Step 1: Deploy the pull update webhook#

  1. Sign into your Indent Space.
  2. Go to your Webhooks.
  3. Click "New" and create a new Webhook.
    • For "Kind of Webhook", select "Pull update."
    • For "Supported Kind of Resource" select "GitHub Team" or type github.v1.Team.
    • Save the webhook and note down the signing secret for use in the deployment process.
  4. Download the example:
curl https://codeload.github.com/indentapis/examples/tar.gz/main | tar -xz --strip=3 examples-main/webhooks/pull/terraform-gcloud-github-teams-pull-webhook
cd terraform-gcloud-github-teams-pull-webhook

Follow the instructions in the README to complete the deployment process.

Pull updates from GitHub Teams#

  1. Enter the HTTP endpoint from Cloud Functions as the "Webhook URL" filed in your new Webhook.
  2. Save the new Webhook.
  3. Go to the Resources, click the dropdown arrow next to "New", click "Pull Update," select "GitHub Teams" in the modal then "Start Pulling Updates."

Now when you search "github" on the Resources page, you should see the teams you've pulled into Indent. Next, we're going to automate team membership changes when access is granted or revoked.

Step 2: Link Slack users to GitHub#

  1. Go to your Resources and click on the user you want to allow access to GitHub Teams.
  2. Add a new Label to the user.
    • For "Label name" type in "github/id"
    • For "Label value" type in the user's GitHub username.
    • Click "Save" at the top of the resource page.

If you have a lot of users, you can select a list of users and update them in bulk.

Step 3: Deploy the change webhook#

Download the example:

curl https://codeload.github.com/indentapis/examples/tar.gz/main |tar -xz --strip=3 examples-main/webhooks/change/terraform-gcloud-github-teams-webhook
cd terraform-gcloud-github-teams-webhook

Follow the instructions in the README to complete the deployment process then save the new webhook in your Indent configuration.

Step 4: Configure your Indent policies#

  1. Open the "Access Request Rules" section and navigate to the rules for your new resource.
  2. Configure the approvers for granting access to your GitHub Teams.

Step 5: Make a test request#

  1. Go to Request Access.
  2. Select your GitHub Team from the dropdown and enter a reason for access.
  3. Once the access is approved, check the group's page to confirm membership.

Congrats! You’ve just configured requesting and managing GitHub Team access with Indent.


Import teams manually#

  1. Sign into your Indent Space.
  2. Go to your Resources.
  3. Click "New" and create a new Resource.
    • Under resource type, type in "github.v1.Team"
    • Enter the name of your GitHub Team.
    • Enter the ID of your GitHub Team.
How do I get my GitHub Team's ID?