33*
44[ ![ GitHub repository stargazers] ( https://img.shields.io/github/stars/op5dev/current-pr )] ( https://github.com/op5dev/current-pr " Become a stargazer. ")
55
6- # Heading
7-
8- Placeholder.
9-
10- <table >
11- <tr >
12- <th>
13- <h3>What does it do?</h3>
14- </th>
15- <th>
16- <h3>Who is it for?</h3>
17- </th>
18- </tr >
19- <tr >
20- <td>
21- <ul>
22- <li>Placeholder.</li>
23- <li>Placeholder.</li>
24- </ul>
25- </td>
26- <td>
27- <ul>
28- <li>Placeholder.</li>
29- <li>Placeholder.</li>
30- </ul>
31- </td>
32- </tr >
33- </table >
34- </br >
35-
36- ### View: [ Usage Examples] ( #usage-examples ) · [ Security] ( #security ) · [ Changelog] ( #changelog ) · [ License] ( #license )
6+ # Get Current PR Data
7+
8+ Supported event triggers:
9+
10+ - ` issue_comment `
11+ - ` merge_group `
12+ - ` push `
13+ - ` pull_request ` (of course!)
14+
15+ </br >
16+
17+ ### View: [ Usage Examples] ( #usage-examples ) · [ In/Output Parameters] ( #parameters ) · [ Security] ( #security ) · [ Changelog] ( #changelog ) · [ License] ( #license )
18+
19+ </br >
3720
3821## Usage Examples
3922
23+ ``` yaml
24+ on :
25+ push :
26+ branches : [main]
27+
28+ jobs :
29+ test :
30+ runs-on : ubuntu-latest
31+
32+ permissions :
33+ contents : read # Required to checkout repository.
34+ pull-requests : read # Required to get PR data.
35+
36+ steps :
37+ - uses : actions/checkout@v4
38+ - id : pr
39+ uses : op5dev/current-pr@v1
40+ - run : echo "PR number is ${{ steps.pr.outputs.number }}"
41+ ` ` `
42+
43+ </br>
44+
45+ ## Parameters
46+
47+ ### Inputs
48+
49+ | Required | Name | Description |
50+ | -------- | ------- | ----------------------------------------------------------- |
51+ | No | ` token` | Specify a GitHub token.</br>Default: `${{ github.token }}`. |
52+
53+ </br>
54+
55+ # ## Outputs
56+
57+ | Name | Description |
58+ | ------------ | --------------------------------- |
59+ | ~~`body`~~ | ~~The body of the current PR.~~ |
60+ | ~~`branch`~~ | ~~The branch of the current PR.~~ |
61+ | `number` | The number of the current PR. |
62+ | ~~`title`~~ | ~~The title of the current PR.~~ |
63+
64+ </br>
65+
4066# # Security
4167
4268View [security policy and reporting instructions](SECURITY.md).
69+
4370</br>
4471
4572# # Changelog
@@ -54,6 +81,14 @@ View [all notable changes](https://github.com/op5dev/current-pr/releases "Releas
5481> - [Raise an issue](https://github.com/op5dev/current-pr/issues "Raise an issue.") to propose changes or report unexpected behavior.
5582> - [Open a discussion](https://github.com/op5dev/current-pr/discussions "Open a discussion.") to discuss broader topics or questions.
5683> - [Become a stargazer](https://github.com/op5dev/current-pr/stargazers "Become a stargazer.") if you find this project useful.
84+
85+ </br>
86+
87+ # ## To-Do
88+
89+ - Output parameters like `body`, `branch`, and `title` will be added in upcoming releases.
90+ - Workflow event triggers like `workflow_dispatch`, and `workflow_run` (fork) will be added in upcoming releases.
91+
5792</br>
5893
5994# # License
0 commit comments