Coder Social home page Coder Social logo

bumdue2233 / repo-automation-bots Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googleapis/repo-automation-bots

0.0 0.0 0.0 38.67 MB

A collection of bots, based on probot, for performing common maintenance tasks across the open-source repos managed by Google on GitHub.

License: Apache License 2.0

Shell 2.66% JavaScript 5.88% Python 0.04% Go 0.86% PowerShell 0.65% TypeScript 87.99% Makefile 0.08% Handlebars 0.33% Batchfile 0.03% Dockerfile 1.46%

repo-automation-bots's Introduction

Repo Automation Bots

A collection of bots, based on probot, for performing common maintenance tasks across the open-source repos managed by Google on GitHub.

Implemented Bots

Name Description Install
auto-approve Automatically approves and merges PRs matching user-specified configs install
auto-label Automatically labels issues and PRs with product, language, or directory based labels install
blunderbuss Assigns issues and PRs randomly to a specific list of users install
cherry-pick-bot Cherry-pick merged PRs between branches install
conventional-commit-lint PR checker that ensures that the commit messages follow conventionalcommits.org style install
do-not-merge PR checker that ensures the do not merge label is not present install
failurechecker Check for automation tasks, e.g., releases, that are in a failed state install
flakybot Listen on PubSub queue for broken builds, and open corresponding issues install
generated-files-bot PR checker to notify if you are modifying generated files install
label-sync Synchronize labels across organizations install
license-header-lint PR checker that ensures that source files contain valid license headers install
merge-on-green Merge a pull-request when all required checks have passed install
policy Check repo configuration against known rules install
release-please Proposes releases based on semantic version commits install
release-trigger Trigger releases jobs install
repo-metadata-lint Lint .repo-metadata.json files 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

Development environment

You need to install node.js version 12 or higher.

To manage multiple Node.js versions, you can use nvm.

Running the app locally

Create a Proxy to Relay Webhooks

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>

Creating the Development Application

If it's your first time running your application, you should create a new GitHub application using the probot server:

  1. cd packages/your-bot.
  2. npm start.
  3. visit: http://localhost:3000 and install.

Granting the Development Application permissions and events

  1. By default there will be no permissions. Visit https://github.com/settings/installations, click configure, then 'app settings'.
  2. Navigate to Permissions and Events. You likely need 'Repository > Pull Requests' for permissions.
  3. 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.

Install the bot on a repo

  1. Follow the link to install the app and navigate to 'Install App', if installed on the organization you desire (likely yourself for testing), click the gear.
  2. Under permissions ensure that there aren't pending requests to be approved
  3. Under repository access select only select repositories. Select the repository you wish to test against.

Running Your Application

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 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.
  • WEBHOOK_SECRET: secret key set in GitHub developer settings. Edit this to a known value in the settings page.

Environment variables set, run:

  1. cd packages/your-bot.
  2. npm start.

Running bots on a Cron

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.

Publishing Utility Modules

  1. create a token with Wombat Dressing Room.
  2. run npm run release.

Overall Architecture

High Level Architecture

repo-automation-bots's People

Contributors

yoshi-code-bot avatar renovate-bot avatar chingor13 avatar bcoe avatar sofisl avatar surferjeffatgoogle avatar release-please[bot] avatar justinbeckwith avatar tbpg avatar azizsonawalla avatar orthros avatar danielbankhead avatar yoshi-automation avatar gcf-owl-bot[bot] avatar alexander-fenster avatar hershey127 avatar losalex avatar 0xsage avatar stephaniewang526 avatar parthea avatar busunkim96 avatar jskeet avatar kurtisvg avatar crwilcox avatar fhinkel avatar suztomo avatar kolea2 avatar jpoehnelt avatar dependabot[bot] avatar noahdietz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.