Example: Automatically issue points to users when they commit code to your repo using Zapier and Absinthe’s API. Simply modify the Zapier Trigger from New Commit to any other GitHub Trigger

Setting Up GitHub Commit Listener

To reward users with points when they commit code to your repository, you’ll need to set up a Zap in Zapier that listens for commit events and then triggers a point issuance through Absinthe’s API.

1

Create a New Zap in Zapier

Log in to your Zapier account and click on “Create Zap”. title

2

Choose GitHub as the Trigger App

Search for “GitHub” in the app selection and choose it as your trigger app. title

3

Select the 'New Commit' Event

From the list of GitHub events, select “New Commit”. title

4

Connect Your GitHub Account

If you haven’t already, you’ll need to connect your GitHub account to Zapier. Follow the prompts to authorize Zapier to access your GitHub.

5

Choose the GitHub repository

Select the specific GitHub repository you want to monitor for commits. title

6

Test the GitHub Trigger

Zapier will attempt to find a recent commit to test the trigger. If successful, proceed to the next step.

7

Add a 'Run JavaScript' Action

For the action step, search for and select “Run JavaScript” by Zapier. title

8

Set Up the JavaScript Action Data

In the Input Data field of the Run JavaScript action, you’ll set the key to user_email and the value to the Author Email from the dropdown. title

9

Set Up the JavaScript Action Code

In the Code field of the Run JavaScript action, you’ll paste and modify the provided JavaScript code to issue points through Absinthe’s API.

Custom JavaScript Action

Use the given JavaScript code in your Zapier “Run JavaScript” action to issue points when a New Commit is created:

Customizing the Action Modify the JavaScript code to suit your specific needs:

Adjust the amount of points issued for each role assignment. Customize the event_name to distinguish between different Discord events.

Ensure you’re passing the necessary data (GitHub user email, etc) from the GitHub trigger step to the JavaScript action in Zapier.

Best Practices When setting up this GitHub Commit integration:

Use a clear and consistent event_name (e.g., “github_commit”) for easy tracking.

By following this guide, you can create a seamless integration between GitHub commits and your Absinthe points system, automatically rewarding users for their engagement within your repository.