Ubiquity DAO's GitHub Bot to automate DevPool management.
#!/bin/bash
git clone https://github.com/ubiquity/ubiquibot.git
cd ubiquibot
yarn
yarn tsc
yarn start:watch
- Copy
.env.example
to.env
- Update
.env
with the following fields: SUPABASE_URL
: Add your Supabase project URL.SUPABASE_KEY
: Add your Supabase project API key.LOGDNA_INGESTION_KEY
: Get it from Memzo by creating an account, adding an organization, and copying the ingestion key on the next screen.FOLLOWUP_TIME
: (optional) Set a custom follow-up time (default: 4 days).DISQUALIFY_TIME
: (optional) Set a custom disqualify time (default: 7 days).
APP_ID
and PRIVATE_KEY
are here for internal developers to use.
If you are an external developer, APP_ID
and PRIVATE_KEY
are automatically generated when you install the app on your repository.
Note: When setting up the project, please do not rename the .env.example
file to .env
as it will delete the environment example from the repository.
Instead, it is recommended to make a copy of the .env.example
file and replace the values with the appropriate ones.
- This bot is designed to exist as a GitHub Action.
- The code must be compiled using
@vercel/ncc
because all the dependencies (e.g.node_modules
) must be included and committed on the repository for the GitHub Actions runner to use.
- Go to the UbiquiBot App Marketplace
- Choose a plan and install UbiquiBot on your repository
- Congratulations! You can now use the UbiquiBot to manage your bounties.
To test the bot, you can:
- Create a new issue
- Add a time label, ex:
Time: <1 Day
- At this point the bot should add a price label.
- Create a new project at Supabase. Add
Project URL
andAPI Key
to the.env
file:
SUPABASE_URL="XXX"
SUPABASE_KEY="XXX"
- Create a new organization at Memzo. Add
LOGDNA_INGESTION_KEY
to the.env
file:
LOGDNA_INGESTION_KEY ="XXX"
- Add
FOLLOW_UP_TIME
andDISQUALIFY_TIME
to the.env
file if you don't want to use default ones.
FOLLOW_UP_TIME="4 days" // 4 days
DISQUALIFY_TIME="7 days" // 7 days
yarn install
- Open 2 terminal instances:
- in one instance run
yarn tsc --watch
(compiles the Typescript code) - in another instance run
yarn start:watch
(runs the bot locally)
- in one instance run
- Open
localhost:3000
and follow instructions to add the bot to one of your repositories.
At this point the .env
files auto-fill the empty fields (PRIVATE_KEY
and APP_ID
) if it is not previously filled.
Now you can make changes to the repository on GitHub (e.g. add a bounty) and the bot should react.
You can, for example:
- Create a new issue
- Add a time label, ex:
Time: <1 Day
- At this point the bot should add a price label, you should see event logs in one of your opened terminals
Bounty bot is built using the probot framework so initially the bot is a github app. But thanks to the probot/adapter-github-actions you can also use the bot as a github action.
You can use the bounty bot as a github app.
When using as a github app the flow is the following:
- Bounty bot is added to a repository as a github app
- You run the bot "backend" (for example on your local machine)
- Some event happens in a repository and the bot should react somehow (for example: on adding a time label to an issue the bot should add a price label)
- Event details are sent to your deployed bot instance (to a webhook URL that was set in github app's settings)
- The bot handles the event
- Update the version in package.json:
yarn version --new-version x.x.x
- Commit and create a new tag:
git commit -am x.x.x && git tag -am x.x.x
- Push tags:
git push origin v"x.x.x"
- The Github action will create a release by recognizing the version tag