Skip to content

GuillaumeFalourd/pull-request-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pull Request Action

Action test on Ubuntu Action test on MacOS Action test on Windows

☞ 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

📝 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 to create a Pull Request.

  • According to the documentation, 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 instead.

Minimum configurations

    - uses: GuillaumeFalourd/pull-request-action@v2
      with:
        destination_branch: "my-branch"
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Full configurations

    - 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

🏅 Licensed

☞ This repository uses the Apache License 2.0