Community Support

Guides for Integrating with GitHub

Integrating with GitHub

This guide will walk you through setting up seamless integrations between our platform and your GitHub repositories. Leverage GitHub for version control, collaboration, and continuous integration to enhance your workflow.

Why Integrate with GitHub?

  • Version Control: Keep track of all changes to your code.
  • Collaboration: Work with your team efficiently using pull requests and code reviews.
  • CI/CD: Automate building, testing, and deploying your applications directly from GitHub.
  • Centralized Information: Link project issues and discussions directly to your code.

Prerequisites

Before you begin, ensure you have:

  • A GitHub account and access to the repository you wish to integrate.
  • Necessary permissions to create webhooks or OAuth applications on GitHub.
  • Your account credentials for our platform.

Step-by-Step Integration

Method 1: Using OAuth for Seamless Access

This is the recommended method for most users, providing a secure and user-friendly experience.

  1. Navigate to your Account Settings on our platform.
  2. Find the "Integrations" or "Connected Accounts" section.
  3. Click the "Connect GitHub" button.
  4. You will be redirected to GitHub to authorize our application.
  5. Grant the requested permissions.
  6. Once authorized, you'll be redirected back to our platform, and your GitHub account will be linked.

Method 2: Setting up GitHub Webhooks

For more granular control and automated event handling, webhooks are essential.

  1. In your GitHub repository, go to "Settings" > "Webhooks".
  2. Click "Add webhook".
  3. Payload URL: Enter the URL provided by our platform (e.g., https://your-platform.com/api/github/webhook).
  4. Content type: Select application/json.
  5. Secret: (Optional but recommended) Generate a secret token and enter it here. You'll need to configure this same secret on our platform.
  6. Which events would you like to trigger this webhook? Choose "Just the push event" or select custom events like "Pull requests", "Issue comments", etc., depending on your needs.
  7. Ensure "Active" is checked.
  8. Click "Add webhook".

You may need to configure the corresponding webhook settings within your account on our platform to receive and process these events.

Example: Receiving a Push Event

When a push event is received, our system can perform actions like updating commit status or triggering a build.

{
  "ref": "refs/heads/main",
  "before": "a1b2c3d4e5f6...",
  "after": "f6e5d4c3b2a1...",
  "repository": {
    "name": "your-repo",
    "full_name": "your-username/your-repo",
    "owner": {
      "login": "your-username"
    }
  },
  "pusher": {
    "name": "your-username",
    "email": "your-email@example.com"
  },
  "commits": [
    {
      "id": "f6e5d4c3b2a1...",
      "message": "feat: Add new integration guide",
      "timestamp": "2023-10-27T10:00:00Z",
      "author": {
        "name": "your-username"
      }
    }
  ]
}

Common Use Cases

  • Linking Commits to Tasks: Mention a task ID in your commit message (e.g., task-123: Implement feature X) to automatically link it.
  • Automated Deployments: Trigger deployments to staging or production environments upon merging to specific branches.
  • Status Updates: Post status updates on your tasks or projects when code is pushed or pull requests are opened/closed.
  • Code Review Reminders: Notify your team when a new pull request is ready for review.

Troubleshooting

If you encounter issues:

  • Check Permissions: Ensure the connected GitHub account has the necessary read/write permissions for the repository.
  • Verify Webhook URLs: Double-check that the Payload URL is correct and accessible from GitHub.
  • Review Secret Keys: If using a secret, ensure it matches exactly in both GitHub and our platform.
  • Consult GitHub Logs: GitHub's webhook delivery logs can provide valuable insights into delivery failures.
  • Contact Support: If problems persist, reach out to our support team.

For more advanced configurations or specific integration scenarios, please refer to our API documentation or contact us directly.