Skip to content
package

GitHub Action

Get PR Number

v0.0.1 Latest version

Get PR Number

package

Get PR Number

Get PR number for mergue queues and squash merges

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Get PR Number

uses: bcgov-nr/[email protected]

Learn more about this action in bcgov-nr/action-get-pr

Choose a version

Issues Pull Requests MIT License Lifecycle

Get PR Number - Merges and Queues

PR numbers are easy to come by in PRs, but passing those same numbers to merge queues and PR-backed merges can get tricky. This action makes that convenient in the following cases:

  • PR merge queues
  • Merged PR workflows
  • PRs themselves (just for consistency)

Usage

The build will return a PR number as output.

- id: vars
  uses: bcgov-nr/[email protected]

- name: Echo PR number
  run: echo "PR: ${{ steps.vars.outputs.pr }}"

Private Repositories

Private repositories may need to provide a GitHub token.

- id: vars
  uses: bcgov-nr/[email protected]
  with:
    token: ${{ secrets.GITHUB_TOKEN }}

- name: Echo PR number
  run: echo "PR: ${{ steps.vars.outputs.pr }}"