https://github.com/bcgov/action-get-pr
Get PR number for merge and queue events
https://github.com/bcgov/action-get-pr
actions bcgov bcgov-wlrs github-actions pull-request pull-requests wlrs
Last synced: 3 months ago
JSON representation
Get PR number for merge and queue events
- Host: GitHub
- URL: https://github.com/bcgov/action-get-pr
- Owner: bcgov
- License: apache-2.0
- Created: 2023-12-06T01:35:00.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-12-02T07:05:31.000Z (6 months ago)
- Last Synced: 2025-12-04T21:58:07.821Z (6 months ago)
- Topics: actions, bcgov, bcgov-wlrs, github-actions, pull-request, pull-requests, wlrs
- Language: Shell
- Homepage:
- Size: 41 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: license
- Codeowners: .github/codeowners
Awesome Lists containing this project
README
[](/../../issues)
[](/../../pulls)
[](/LICENSE)
[](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md)
# Get PR Number - Merges and Queues
PR numbers are easy to come by in PRs, but passing those same numbers to releases, merge queues and PR-backed merges can get tricky. This action makes that convenient in the following cases:
* PR merge queues
* Merged PR workflows
* Release events (finds the most recently merged PR)
* PRs themselves (just for consistency)
This process has been an integral part of PR-based workflows where images are promoted from development (PRs) to test/staging to production. It is also useful for release events where the most recent PR is tied to the release.
# Usage
The build will return a PR number as output.
```yaml
- id: vars
uses: bcgov/action-get-pr@vX.Y.Z
- name: Echo PR number
run: echo "PR: ${{ steps.vars.outputs.pr }}"
```
# Private Repositories
Private repositories may need to provide a GitHub token.
```yaml
- id: vars
uses: bcgov/action-get-pr@vX.Y.Z
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Echo PR number
run: echo "PR: ${{ steps.vars.outputs.pr }}"
```