Code Monkey home page Code Monkey logo

pr-revert's Introduction

pr-revert

pr-revert is a tool for reverting pull requests.

:octocat: GitHub Actions for pr-revert is here !!

Usage

Default behavior

  1. Clone repository from remote to temporary working directory.
  2. Create a branch to stack revert commits.
  3. Revert pull requests.
  4. Push branch to remote repository.
  5. Create a pull request.
  6. Cleanup temporary working directory.

Revert a pull request by number (#3)

$ pr-revert --number 3

Revert latest 5 merged pull requests

$ pr-revert --latest 5

Revert all merged pull requests until 2 hours

$ pr-revert --until '2 hours'

Revert pull requests without new pull request

$ pr-revert --latest 3 --no-pull-request

Revert pull requests without cleanup

$ pr-revert --latest 3 --no-cleanup

Revert pull requests and push to default branch of remote repository

$ pr-revert --latest 3 --no-branch

Requirements

  • Git

Required Environment Variables

Environment variable Description Default
GITHUB_TOKEN A GitHub access token. -
GITHUB_REPOSITORY The owner and repository name ( owner/repo ) -
GITHUB_SERVER_URL The the GitHub server URL. https://github.com
GITHUB_API_URL The GitHub API URL https://api.github.com
GITHUB_GRAPHQL_URL The GitHub GraphQL API URL https://api.github.com/graphql

Environment Variables

Environment variable Description
PR_REVERT_LATEST Can be used instead of the --latest option
PR_REVERT_UNTIL Can be used instead of the --until option
PR_REVERT_NUMBER Can be used instead of the --number option
PR_REVERT_NO_PUSH Can be used instead of the --no-push option
PR_REVERT_NO_PULL_REQUEST Can be used instead of the --no-pull-request option
PR_REVERT_NO_CLEANUP Can be used instead of the --no-cleanup option
PR_REVERT_NO_BRANCH Can be used instead of the --no-branch option

Install

deb:

Use dpkg-i-from-url

$ export PR-REVERT_VERSION=X.X.X
$ curl -L https://git.io/dpkg-i-from-url | bash -s -- https://github.com/k1LoW/pr-revert/releases/download/v$PR-REVERT_VERSION/pr-revert_$PR-REVERT_VERSION-1_amd64.deb

RPM:

$ export PR-REVERT_VERSION=X.X.X
$ yum install https://github.com/k1LoW/pr-revert/releases/download/v$PR-REVERT_VERSION/pr-revert_$PR-REVERT_VERSION-1_amd64.rpm

apk:

Use apk-add-from-url

$ export PR-REVERT_VERSION=X.X.X
$ curl -L https://git.io/apk-add-from-url | sh -s -- https://github.com/k1LoW/pr-revert/releases/download/v$PR-REVERT_VERSION/pr-revert_$PR-REVERT_VERSION-1_amd64.apk

homebrew tap:

$ brew install k1LoW/tap/pr-revert

manually:

Download binary from releases page

go get:

$ go get github.com/k1LoW/pr-revert

docker:

$ docker pull ghcr.io/k1low/pr-revert:latest

pr-revert's People

Contributors

dependabot[bot] avatar k1low avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

syllogy

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.