Giter VIP home page Giter VIP logo

pull-request's Introduction

GitHub Pull Request

All Contributors

A GitHub Action for creating pull requests.

Features

  • Create pull requests
  • Add reviewers, assignees, labels, or milestones
  • Customize pull request title and body
  • Fail silently when a pull request already exists

Usage

GitHub Actions

# File: .github/workflows/pull-request.yml

on:
  push:
    branches:
    - feature-1

jobs:
  pull-request:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: pull-request
      uses: repo-sync/pull-request@v2
      with:
        destination_branch: "main"
        github_token: ${{ secrets.GITHUB_TOKEN }}

This will automatically create a pull request from feature-1 to main.

Create Multi PR

# File: .github/workflows/pull-request.yml

on:
  push:
    branches:
    - feature-1

jobs:
  pull-request:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: pull-request
      uses: repo-sync/pull-request@v2
      with:
        destination_branch: "main;master"
        github_token: ${{ secrets.GITHUB_TOKEN }}

This will automatically create 2 pull request from feature-1 to main and master.

Advanced options

on:
  push:
    branches:
    - "feature/*"  # Support wildcard matching

jobs:
  pull-request:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: pull-request
      uses: repo-sync/pull-request@v2
      with:
        source_branch: ""                                 # If blank, default: triggered branch
        destination_branch: "master"                      # If blank, default: master
        pr_title: "Pulling ${{ github.ref }} into master" # Title of pull request
        pr_body: ":crown: *An automated PR*"              # Full markdown support, requires pr_title to be set
        pr_template: ".github/PULL_REQUEST_TEMPLATE.md"   # Path to pull request template, requires pr_title to be set, excludes pr_body
        pr_reviewer: "wei,worker"                         # Comma-separated list (no spaces)
        pr_assignee: "wei,worker"                         # Comma-separated list (no spaces)
        pr_label: "auto-pr"                               # Comma-separated list (no spaces)
        pr_milestone: "Milestone 1"                       # Milestone name
        pr_draft: true                                    # Creates pull request as draft
        pr_allow_empty: true                              # Creates pull request even if there are no changes
        github_token: ${{ secrets.GITHUB_TOKEN }}

Outputs

The following outputs are available: pr_url, pr_number, has_changed_files ("true"|"false").

on:
  push:
    branches:
    - feature-1

jobs:
  pull-request:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: pull-request
      id: open-pr
      uses: repo-sync/pull-request@v2
      with:
        destination_branch: "main"
        github_token: ${{ secrets.GITHUB_TOKEN }}
    - name: output-url
      run: echo ${{steps.open-pr.outputs.pr_url}}
    - name: output-number
      run: echo ${{steps.open-pr.outputs.pr_number}}
    - name: output-has-changed-files
      run: echo ${{steps.open-pr.outputs.has_changed_files}}

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Wei He

💻 📖 🎨 🤔

Zeke Sikelianos

📖 🤔

Gobius Dolhain

💻

James Netherton

💻

Krzysztof Szyper

💻

Michał Koza

💻

Tonye Jack

📖

James M. Greene

💻

simon3000

🐛 💻

Pablo Barrenechea

🐛 💻

Atsushi Watanabe

🐛 💻

Christopher Keele

💻

Rachael Sewell

💻

TheKoenig

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

pull-request's People

Contributors

wei avatar allcontributors[bot] avatar zeke avatar quanha-0878 avatar at-wat avatar christhekeele avatar goobles avatar jamesmgreene avatar jamesnetherton avatar christophshyper avatar michalkoza avatar pablobarrenechea-reflektion avatar rachmari avatar thekoenig avatar jackton1 avatar simon300000 avatar

Watchers

James Cloos 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.