Code Monkey home page Code Monkey logo

backport-action's Introduction

Backport Action

The purpose of this action is to backport commits between branches.

When a label following the convention backport-{branch} is added to a merged Pull Request, the action will try to cherry pick all the commits associated to the labeled Pull Request and open a new Pull Request to the target {branch} with the commits to apply.

If the backport is not possible due to conflicts, the action will make a comment in the original Pull Request that the backport failed, and it must be handled manually.

Inputs

github-token

Required The GitHub Token used to create an authenticated client. The Github Token is already set by the Github Action itself. Use this if you want to pass in your own Personal Access Token.

Default ${{github.token}}.

Example usage

name: Backport
on:
  pull_request:
    types:
      - closed
      - labeled

jobs:
  backport:
    runs-on: ubuntu-latest
    name: Backport
    steps:
      - name: Backport
        uses: radcortez/backport-action@main
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
        env:
          GIT_COMMITTER_NAME: ${{ env.GITHUB_ACTOR }}
          GIT_COMMITTER_EMAIL: [email protected]

The GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL are used for the name and email of the cherry pick committer. The action maintains the original committer author. These options are optional.

Standalone

It is also possible to use the Backport Action directly from your local environment or with any other CI. Please refer to backport.java. This requires JBang to run the script.

The same rules apply. The target Pull Request require backport labels and the script will either create backport Pull Request or report issues.

Usage

jbang backport.java <token> <repository> <pullRequestNumber>

backport-action's People

Contributors

radcortez avatar

Watchers

 avatar  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.