The Github integration removes the barrier of manually updating information from Github to Hive. With this integration, Hive Actions can be associated with Github Branches and automatically capture branch activity.
Your team can quickly view and jump to commits, pull requests, and branches from Hive.
The workflow can also be automated so that an action's status in Hive updates accordingly when a pull request is opened, closed, and merged,
Setting up the integration
To enable the Github integration for your workspace, head over to "Apps" and enable Github:
Once Github is toggled on from the Hive Apps menu, click the 'Open' button to manage the integration.
To connect Hive with Github, Hive uses Github's Webhook functionality. You'll need to copy the Github Payload URL from Hive:
Next, go to the Github repository you want to connect with and select "Settings":
Then select "Webhooks":
Select "Add webhook":
From here, you'll need to fill in the webhook fields as follows:
Payload URL: Use the URL copied from Hive
Content type: Select "application/json"
Secret: Go back to Hive, copy the "Github secret" field, and paste it here
Finally, select the "Send me everything" option and add the webhook.
It should look something like this:
Associating Hive Actions with Github Branches
Once enabled, the Github Integration will show a new section when you open Actions in Hive. If you open an action, you'll see a new button to 'Attach branch':
From here, you can enter a branch name you'd like to track:
Once added, any branch activity which happens after initial integration setup will appear on the Action:
Once Hive catches activity on the branch, this area will populate with that activity and provide quick links to it. You'll also have quick links to view the branch or pull request on Github from here.
Automatically update the status of Hive Actions from Github Events
One of the primary benefits of the integration is the ability to automatically update Hive Action statuses on events like pull request open, close, and merge.
For example, if your team's workflow involves peer code review, you can set up a "Ready for Review" status. Hive will automate this by setting up a Github Event Handler so that on Pull Request Open, the action associated with the pull request branch is moved to the status automatically.
To configure this example, go to the Github Integration menu and select "Add event handler":
From here you can select the event you want to listen to. In this case we'll select "When a pull request is opened".
Next, we'll select the status we want to set the associated action to. We'll select our custom status of "Ready for Review":
Once we save the event handler, you should see action status updates happen automatically when pull requests are opened.
Add branches from different repositories to a card
For each repository you'd like to make available to your workspace, follow the steps above to set up the Github webhooks.
Then, on an action card, simply prefix the branch names with the repository name.
Let's say we have connected two repositories: HiveWeb and HiveDesktop.
On an action card, click the Github integration icon and add "HiveWeb:feature/branch-name".
Click the add icon again to add a branch from the other repository, such as "HiveDesktop:feature/branch-name".
Now both branches are tracked in Hive!