Skip to content

Commit ffcacf9

Browse files
authored
docs: initial release (#3)
* docs: initial release Signed-off-by: Rishav Dhar <19497993+rdhar@users.noreply.github.com> * ci major release workflow Signed-off-by: Rishav Dhar <19497993+rdhar@users.noreply.github.com> --------- Signed-off-by: Rishav Dhar <19497993+rdhar@users.noreply.github.com>
1 parent ff5b520 commit ffcacf9

2 files changed

Lines changed: 90 additions & 31 deletions

File tree

.github/workflows/ci_release.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: CI Release Tag
3+
4+
on:
5+
release:
6+
types: [created]
7+
8+
jobs:
9+
tag:
10+
runs-on: ubuntu-24.04
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
16+
- name: Fetch major version tag and update it
17+
shell: bash
18+
run: |
19+
VERSION=${GITHUB_REF#refs/tags/}
20+
MAJOR=${VERSION%%.*}
21+
git config --global user.name 'Rishav Dhar'
22+
git config --global user.email '19497993+rdhar@users.noreply.github.com'
23+
git tag -fa "${MAJOR}" -m 'Update major version tag'
24+
git push origin "${MAJOR}" --force

README.md

Lines changed: 66 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,70 @@
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

4268
View [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

Comments
 (0)