Skip to content

Repository files navigation

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.ymlon:
push:
branches:
- feature-1jobs:
pull-request:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v2
- name: pull-requestuses: repo-sync/pull-request@v2with:
destination_branch: "main"github_token: ${{ secrets.GITHUB_TOKEN }}

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

Advanced options

on:
push:
branches:
- "feature/*"# Support wildcard matchingjobs:
pull-request:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v2
- name: pull-requestuses: repo-sync/pull-request@v2with:
source_branch: ""# If blank, default: triggered branchdestination_branch: "master"# If blank, default: masterpr_title: "Pulling ${{ github.ref }} into master"# Title of pull requestpr_body: ":crown: *An automated PR*"# Full markdown support, requires pr_title to be setpr_template: ".github/PULL_REQUEST_TEMPLATE.md"# Path to pull request template, requires pr_title to be set, excludes pr_bodypr_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 namepr_draft: true # Creates pull request as draftpr_allow_empty: true # Creates pull request even if there are no changesgithub_token: ${{ secrets.GITHUB_TOKEN }}

Outputs

If given an id, the outcome of the pull-request step can be referenced in later steps. Two outputs are available: pr_url and pr_number.

on:
push:
branches:
- feature-1jobs:
pull-request:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v2
- name: pull-requestid: open-pruses: repo-sync/pull-request@v2with:
destination_branch: "main"github_token: ${{ secrets.GITHUB_TOKEN }}
- name: output-urlrun: echo ${{steps.open-pr.outputs.pr_url}}
- name: output-numberrun: echo ${{steps.open-pr.outputs.pr_number}}

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

💻

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

About

⤵️ A GitHub Action for creating pull requests

Resources

Code of conduct

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages