A collection of bots, based on probot, for performing common maintenance tasks across the open-source repos managed by Google on GitHub.
Name | Description | Install |
---|---|---|
auto-label | Automatically labels issues and PRs with product or language labels | install |
blunderbuss | Assigns issues and PRs randomly to a specific list of users | install |
buildcop | Listen on PubSub queue for broken builds, and open corresponding issues | install |
conventional-commit-lint | PR checker that ensures that the commit messages follow conventionalcommits.org style | install |
failurechecker | Check for automation tasks, e.g., releases, that are in a failed state | install |
license-header-lint | PR checker that ensures that source files contain valid license headers | install |
label-sync | Synchronize labels across organizations | install |
merge-on-green | Merge a pull-request when all required checks have passed | install |
publish | Publish to npm, through Wombat Dressing Room | install |
release-please | Proposes releases based on semantic version commits | install |
snippet-bot | Check for mismatched region tags in PRs | install |
sync-repo-settings | Synchronize repository settings from a centralized config | install |
trusted-contribution | Allows Kokoro CI to trigger for trusted contributors | install |
You need to install node.js version 12 or higher.
To manage multiple Node.js versions, you can use nvm.
In order to forward to your local machine, you can use smee.io. Visit https://smee.io/new and create a proxy for relaying webhooks to your local web-service. After creating the proxy, you'll get the URL of the new proxy.
In the root directory of repo-automation-bots
, run:
npm run proxy -- -u <URL-OF-PROXY>
If it's your first time running your application, you should create a new GitHub application using the probot server:
cd packages/your-bot
.npm start
.- visit: http://localhost:3000 and install.
- By default there will be no permissions. Visit https://github.com/settings/installations, click configure, then 'app settings'.
- Navigate to Permissions and Events. You likely need 'Repository > Pull Requests' for permissions.
- You also will need to subscribe to events (bottom of page). For instance, if your bot responds to PR activity, the 'Events > Pull Request' should be enabled.
- While on https://github.com/settings/apps/{YOUR_APP} navigate to 'Install App', if installed on the organization you desire (likely yourself for testing), click the gear.
- Under permissions ensure that there aren't pending requests to be approved
- Under repository access select only select repositories. Select the repository you wish to test against.
Once you've created your application, and installed it on some of your repos, start probot again, setting the following environment variables. Most can be found at https://github.com/settings/apps/{YOUR_APP}:
APP_ID
: the ID, listed near the top,App ID: 12345
PRIVATE_KEY_PATH
: path to App's private key, you can request a new one be created and downloaded at the bottom of the page.- Alternatively, set the GitHub client ID and secret:
GITHUB_CLIENT_ID
: client ID from the top of the page.GITHUB_CLIENT_SECRET
: client secret from the top of the page.
- Alternatively, set the GitHub client ID and secret:
WEBHOOK_SECRET
: secret key set in GitHub developer settings. Edit this to a known value in the settings page.
Environment variables set, run:
cd packages/your-bot
.npm start
.
To run a bot on a schedule include a file in your bot's folder named cron
whose
content is valid unix -cron format.
This will create a Cloud Scheduler Job which makes requests to your endpoint
at the specified schedule.
- create a token with Wombat Dressing Room.
- run
npm run release
.