GitHub Integration
Introduction
You can connect DataJet to your GitHub account. This integration can be used, for example, to:
The integration works both ways. Any change made in the DataJet script editor is automatically pushed to your repository, and any change pushed to the repository is automatically reflected in your DataJet scripts.
Prerequisites
Before connecting a GitHub repository with DataJet, you need to have your repository created, ensure that your GitHub user has full permissions to the repository, and install DataJet on your Shopify store.
Setup
Following steps are requiored to complete the setup:
Create fine-grained access token to your Github repository
Connect repository via DataJet settings
Connect script with a file from repository
Create fine-grained access token
This API access token is used to push any changes from DataJet to your repository. To create the token, follow the instructions on the GitHub website. Under the Repository Access section - ensure that your token has access only to the repository you created for DataJet scripts:
Under Permissions, select Read and write access for Webhooks and Contents
After creating the token, copy it. We will use it in the next step.
Connect repository via DataJet settings
Open the DataJet app and go to Settings. At very bottom, select the Connect GitHub checkbox and paste your token. Click the Connect button. You should now see repository for which you created the token. Select it and click Save connection. If the connection is successful, a green confirmation message will appear at the bottom.
You can now close settings and go to Developer Console to connect your first script.
Connect script with a file from repository
Before connecting the script with a file from the repository, ensure that the file is present in your repository. If it isn't, create it before proceeding to the next step.
For the purpose of this tutorial, we will create an order-created.dj
file inside the webhooks
directory.
Now we can create a new script in the DataJet Developer Console and connect it to a file created in our repository. After creating the file select cogwheel next to the script name, then choose GitHub. In the modal, select the branch and file.
Connect and close the modal. Your script is now connected to a file in your repository. Any changes to the file will be reflected in the script code, and vice versa.
Last updated