https://github.com/solarwinds/pull-request
https://github.com/solarwinds/pull-request
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/solarwinds/pull-request
- Owner: solarwinds
- License: mit
- Created: 2021-06-09T14:18:58.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-11T10:23:06.000Z (over 2 years ago)
- Last Synced: 2025-01-07T19:43:12.936Z (12 months ago)
- Language: Shell
- Homepage:
- Size: 50.8 KB
- Stars: 2
- Watchers: 24
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# GitHub Pull Request
[](#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
```yaml
# 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`.
## Advanced options
```yaml
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")`.
```yaml
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](https://allcontributors.org/docs/en/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
π»
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!