https://github.com/guillaumefalourd/pull-request-action
Github Actions to create pull request (all os supported) using Github CLI ⤵️
https://github.com/guillaumefalourd/pull-request-action
all-os-supported github-actions github-cli pull-request
Last synced: 4 months ago
JSON representation
Github Actions to create pull request (all os supported) using Github CLI ⤵️
- Host: GitHub
- URL: https://github.com/guillaumefalourd/pull-request-action
- Owner: GuillaumeFalourd
- License: apache-2.0
- Created: 2022-03-10T13:30:58.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-04T11:26:53.000Z (about 1 year ago)
- Last Synced: 2025-05-26T13:59:20.321Z (4 months ago)
- Topics: all-os-supported, github-actions, github-cli, pull-request
- Homepage: https://github.com/marketplace/actions/pull-request-action-github-cli
- Size: 35.2 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Pull Request Action
[](https://github.com/GuillaumeFalourd/pull-request-action/actions/workflows/ubuntu_action_test.yml) [](https://github.com/GuillaumeFalourd/pull-request-action/actions/workflows/macos_action_test.yml) [](https://github.com/GuillaumeFalourd/pull-request-action/actions/workflows/windows_action_test.yml)

☞ Github Actions to create pull request using Github CLI ⤵️
_**Note**: This action is supported on **all runners** operating systems (`ubuntu`, `macos`, `windows`)_
_Inspired from [https://github.com/repo-sync/pull-request](https://github.com/repo-sync/pull-request)_
## 📝 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
- This action uses [Github CLI](https://cli.github.com/) to create a Pull Request.
- [According to the documentation](https://docs.github.com/en/actions/using-workflows/using-github-cli-in-workflows), to authenticate on the workflow using Github CLI, you need to set the GITHUB_TOKEN context variable as environment variable.
- Note that if you need specific permissions, you can also set a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) instead.
### Minimum configurations
```yaml
- uses: GuillaumeFalourd/pull-request-action@v2
with:
destination_branch: "my-branch"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```### Full configurations
```yaml
- uses: GuillaumeFalourd/pull-request-action@v2
with:
source_branch: "main" # If blank, default: triggered branch
destination_branch: "feature" # If blank, default: main
pr_title: "Pulling ${{ github.ref }} into main" # Title of pull request
pr_body: "An automated PR" # Full markdown support, requires pr_title to be set
pr_reviewer: "john, britney" # Comma-separated list (no spaces)
pr_assignee: "john" # 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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Can use PAT as secret
```## 🧩 Outputs
Field | Observation
------------ | ------------
`pr_url` | Pull request URL
`pr_number` | Pull request number
`has_changed_files` | Boolean string indicating whether any file has been changed
`pr_created` | Boolean string indicating whether a PR was created## 🤝 Contributing
☞ If you're interested in contributing to this repository, please follow the [guidelines](https://github.com/GuillaumeFalourd/pull-request-action/blob/main/CONTRIBUTING.md)
## 🏅 Licensed
☞ This repository uses the [Apache License 2.0](https://github.com/GuillaumeFalourd/pull-request-action/blob/main/LICENSE)