Coder Social home page Coder Social logo

pr-daikou's Introduction

pr-daikou

CircleCI Gem Version

pr-daikou is agency script for Create Pull Request.

By requesting a build to CI service (e.g. CircleCI) to execute this script, Automatic code correction (e.g. rubocop --auto-correct, bundle update) is invoked, then commit changes and create pull request to GitHub repository if there some changes exist.

Installation

Add this line to your application's Gemfile:

gem 'pr-daikou'

And then execute:

$ bundle

Or install it yourself as:

$ gem install pr-daikou

Usage

Setting GitHub personal access token to CircleCI

GitHub personal access token is required for sending pull requests to your repository.

  1. Go to your account's settings page and generate a personal access token with "repo" scope
  2. On CircleCI dashboard, go to your application's "Project Settings" -> "Environment Variables"
  3. Add an environment variable GITHUB_ACCESS_TOKEN with your GitHub personal access token

Configure circle.yml

Configure your .circleci/config.yml to run pr-daikou, for example:

CircleCI1.0

deployment:
  code_correction:
    branch: develop
    commands:
      - automatic code correction command (e.g. rubocop --auto-correct || true)
      - pr-daikou

CircleCI2.0

version: 2

jobs:
  build:
    docker:
      - image: circleci/ruby:2.5
    steps:
      - checkout
      - run: bundle install -j4 --retry=3
      - run: automatic code correction command (e.g. rubocop --auto-correct || true)
      - run: pr-daikou

CLI command references

General usage:

$ pr-daikou --help
Usage: pr-daikou [options]
        --email EMAIL                git committed user email, default: pr_daikou@example.com
        --name NAME                  git committed user name, default: pr_daikou
    -T, --title TITLE                pull request title, default: PR daikou [at Mon Jan 1 12:34:56 UTC 2017]
        --description DESC           pull request description, default: ""
    -m, --commit MESSAGE             add git commit message, default: :robot: PR daikou
    -b, --base BRANCH                pull request base branch, default: master
    -t, --topic BRANCH               create new branch, default: ci/pr-daikou_[20170101123456.000]
    -L, --labels LABELS              add labels, which should be separated with comma, default: ""
    -P, --only-pullrequest           Create Pull requests, default: false

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/rvillage/pr-daikou. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the pr-daikou project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

pr-daikou's People

Contributors

rvillage avatar bluerabbit avatar

Stargazers

 avatar Masato Oba avatar sadao komaki avatar Yuji Ueki avatar Daishi Miyamoto avatar Ryosuke Sato avatar Taiki Yoshino avatar milligramme avatar  avatar Kota Fujiwara avatar Michael H. Oshita avatar  avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

bluerabbit

pr-daikou's Issues

--pullrequestオプションにnil渡すとエラーになる

/usr/local/bundle/gems/pr-daikou-0.0.1/lib/pr-daikou/cli.rb:25:in `parse': missing argument: --pullrequest (OptionParser::MissingArgument)
	from /usr/local/bundle/gems/pr-daikou-0.0.1/lib/pr-daikou/cli.rb:8:in `parse_options'
	from /usr/local/bundle/gems/pr-daikou-0.0.1/bin/pr-daikou:5:in `<top (required)>'
	from /usr/local/bundle/bin/pr-daikou:23:in `load'
	from /usr/local/bundle/bin/pr-daikou:23:in `<main>'
Exited with code 1

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.