https://github.com/op5dev/current-pr
Get current PR data from any event trigger, including: issue_comment, merge_group, push, and workflow_dispatch.
https://github.com/op5dev/current-pr
automation cicd-pipeline devops github-actions
Last synced: 6 months ago
JSON representation
Get current PR data from any event trigger, including: issue_comment, merge_group, push, and workflow_dispatch.
- Host: GitHub
- URL: https://github.com/op5dev/current-pr
- Owner: OP5dev
- License: apache-2.0
- Created: 2024-12-30T13:45:46.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-03-30T20:47:14.000Z (6 months ago)
- Last Synced: 2025-04-06T07:39:57.088Z (6 months ago)
- Topics: automation, cicd-pipeline, devops, github-actions
- Homepage: https://OP5.dev/s/current-pr
- Size: 35.2 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
[](LICENSE "Apache License 2.0.")
[](https://github.com/op5dev/current-pr/releases "View all releases.")
*
[](https://github.com/op5dev/current-pr "Become a stargazer.")# Get Current PR Data
Supported event triggers:
- `push`
- `merge_group`
- `issue_comment`
- `workflow_dispatch`
- `pull_request` (of course!)### View: [Usage Examples](#usage-examples) · [In/Output Parameters](#parameters) · [Security](#security) · [Changelog](#changelog) · [License](#license)
## Usage Examples
```yaml
on:
push:
merge_group:
issue_comment:
workflow_dispatch:jobs:
test:
runs-on: ubuntu-latestpermissions:
pull-requests: read # Required to get PR data.steps:
- id: pr
uses: op5dev/current-pr@v1
- run: |
echo "PR number ${{ steps.pr.outputs.number }}"
echo "PR branch ${{ steps.pr.outputs.branch }}"
```## Parameters
### Inputs
| Name | Description |
| ------- | -------------------------------------------------------------------------- |
| `token` | Specify a GitHub token (not required).Default: `${{ github.token }}`. |### Outputs
| Name | Description |
| -------- | ------------------ |
| `branch` | Current PR branch. |
| `number` | Current PR number. |## Security
View [security policy and reporting instructions](SECURITY.md).
## Changelog
View [all notable changes](https://github.com/op5dev/current-pr/releases "Releases.") to this project in [Keep a Changelog](https://keepachangelog.com "Keep a Changelog.") format, which adheres to [Semantic Versioning](https://semver.org "Semantic Versioning.").
> [!TIP]
>
> All forms of **contribution are very welcome** and deeply appreciated for fostering open-source projects.
>
> - [Create a PR](https://github.com/op5dev/current-pr/pulls "Create a pull request.") to contribute changes you'd like to see.
> - [Raise an issue](https://github.com/op5dev/current-pr/issues "Raise an issue.") to propose changes or report unexpected behavior.
> - [Open a discussion](https://github.com/op5dev/current-pr/discussions "Open a discussion.") to discuss broader topics or questions.
> - [Become a stargazer](https://github.com/op5dev/current-pr/stargazers "Become a stargazer.") if you find this project useful.## License
- This project is licensed under the permissive [Apache License 2.0](LICENSE "Apache License 2.0.").
- All works herein are my own, shared of my own volition, and [contributors](https://github.com/op5dev/current-pr/graphs/contributors "Contributors.").
- Copyright 2016-present [Rishav Dhar](https://github.com/rdhar "Rishav Dhar's GitHub profile.") — All wrongs reserved.