Skip to content

datadrivers/pull-request-action

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pull Request Action

[Action tests]

☞ 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

Original Code from github.com/GuillaumeFalourd/pull-request-action

📝 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: datadrivers/pull-request-action@v2
      with:
        destination_branch: "main"
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Full configurations

    - uses: datadrivers/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