Skip to content

Commit 16a3a68

Browse files
Update docs and release reference (#185)
Co-authored-by: ChristophShyper <45788587+ChristophShyper@users.noreply.github.com>
1 parent 02eb1e0 commit 16a3a68

File tree

4 files changed

+77
-55
lines changed

4 files changed

+77
-55
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
!LICENSE
66
!README.md
77
!entrypoint.sh
8+
!action-pull-request.png

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
curl -LsS https://raw.githubusercontent.com/devops-infra/.github/master/PULL_REQUEST_TEMPLATE.md -o .tmp/PULL_REQUEST_TEMPLATE.md
7878
7979
- name: Create Pull Request
80-
uses: devops-infra/action-pull-request@v0.6.0
80+
uses: devops-infra/action-pull-request@v0.6
8181
with:
8282
github_token: ${{ secrets.GITHUB_TOKEN }}
8383
assignee: ${{ github.actor }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ ARG AUTHOR="Krzysztof Szyper / ChristophShyper / biotyk@mail.com"
4343
ARG HOMEPAGE="https://shyper.pro"
4444
ARG BUILD_DATE=2020-04-01T00:00:00Z
4545
ARG VCS_REF=abcdef1
46-
ARG VERSION=v0.0
46+
ARG VERSION
4747
LABEL \
4848
com.github.actions.name="${NAME}" \
4949
com.github.actions.author="${AUTHOR}" \

README.md

Lines changed: 74 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1-
# GitHub Action for creating Pull Requests
1+
# 🚀 GitHub Action for creating Pull Requests
22

33
**GitHub Action that will create a pull request from the currently selected branch.**
44

55
**Useful in combination with my other action [devops-infra/action-commit-push](https://github.com/devops-infra/action-commit-push).**
66

7+
8+
## 📦 Available on
79
Dockerized as [devopsinfra/action-pull-request](https://hub.docker.com/repository/docker/devopsinfra/action-pull-request).
8-
Built from [devops-infra/action-pull-request](https://github.com/devops-infra/action-pull-request).
10+
Built from [ghcr.io/devops-infra//action-pull-request](https://github.com/devops-infra/pkgs/container/template-action).
11+
12+
13+
## ✨ Features
14+
* Creates pull request if triggered from a current branch or any specified by `source_branch` to a `target_branch`
15+
* Title and body of a pull request can be specified with `title` and `body`
16+
* Can assign `assignee`, `reviewer`, one or more `label`, a `milestone` or mark it as a `draft`
17+
* Can replace any `old_string` inside a pull request template with a `new_string`. Or put commits' subjects in place of `old_string`
18+
* When `get_diff` is `true` will add list of commits in place of `<!-- Diff commits -->` and list of modified files in place of `<!-- Diff files -->` in a pull request template
19+
* When `allow_no_diff` is set to true will continue execution and create pull request even if both branches have no differences, e.g. having only a merge commit
20+
* Supports both `amd64` and `arm64` architectures
21+
922

1023
## Badge swag
1124
[
@@ -22,31 +35,33 @@ Built from [devops-infra/action-pull-request](https://github.com/devops-infra/ac
2235
![Docker Pulls](https://img.shields.io/docker/pulls/devopsinfra/action-pull-request?color=blue&label=Pulls&logo=docker&style=plastic)
2336
](https://hub.docker.com/r/devopsinfra/action-pull-request "shields.io")
2437

25-
## Reference
38+
39+
## 📖 API Reference
2640

2741
```yaml
28-
- name: Run the Action
29-
uses: devops-infra/action-pull-request@v0.6.0
30-
with:
31-
github_token: ${{ secrets.GITHUB_TOKEN }}
32-
source_branch: development
33-
target_branch: master
34-
title: My pull request
35-
template: .github/PULL_REQUEST_TEMPLATE.md
36-
body: "**Automated pull request**"
37-
reviewer: octocat
38-
assignee: octocat
39-
label: enhancement
40-
milestone: My milestone
41-
draft: true
42-
old_string: "<!-- Add your description here -->"
43-
new_string: "** Automatic pull request**"
44-
get_diff: true
45-
ignore_users: "dependabot"
46-
allow_no_diff: false
42+
- name: Run the Action
43+
uses: devops-infra/action-pull-request@v0.6
44+
with:
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
source_branch: development
47+
target_branch: master
48+
title: My pull request
49+
template: .github/PULL_REQUEST_TEMPLATE.md
50+
body: "**Automated pull request**"
51+
reviewer: octocat
52+
assignee: octocat
53+
label: enhancement
54+
milestone: My milestone
55+
draft: true
56+
old_string: "<!-- Add your description here -->"
57+
new_string: "** Automatic pull request**"
58+
get_diff: true
59+
ignore_users: "dependabot"
60+
allow_no_diff: false
4761
```
4862
49-
## Inputs
63+
64+
### 🔧 Input Parameters
5065
5166
| Input Variable | Required | Default | Description |
5267
|----------------|----------|-------------------------------|-------------------------------------------------------------------------------------------------------------------------|
@@ -67,24 +82,16 @@ Built from [devops-infra/action-pull-request](https://github.com/devops-infra/ac
6782
| ignore_users | No | `"dependabot"` | List of users to ignore, comma separated |
6883
| allow_no_diff | No | `false` | Allows to continue on merge commits with no diffs |
6984

70-
## Outputs
85+
86+
### 🔧 Input Parameters
7187

7288
| Output | Description |
7389
|-----------|-------------------------------|
7490
| url | Pull request URL |
7591
| pr_number | Number of GitHub pull request |
7692

77-
## Features
7893

79-
* Creates pull request if triggered from a current branch or any specified by `source_branch` to a `target_branch`
80-
* Title and body of a pull request can be specified with `title` and `body`
81-
* Can assign `assignee`, `reviewer`, one or more `label`, a `milestone` or mark it as a `draft`
82-
* Can replace any `old_string` inside a pull request template with a `new_string`. Or put commits' subjects in place of `old_string`
83-
* When `get_diff` is `true` will add list of commits in place of `<!-- Diff commits -->` and list of modified files in place of `<!-- Diff files -->` in a pull request template
84-
* When `allow_no_diff` is set to true will continue execution and create pull request even if both branches have no differences, e.g. having only a merge commit
85-
* Supports both `amd64` and `arm64` architectures
86-
87-
### How get_diff works
94+
### ➿ How get_diff works
8895

8996
In previous versions occurrences of following strings in a template result with replacing them with list of commits and list of modified files (`<!-- Diff commits -->` and `<!-- Diff files -->`).
9097

@@ -98,14 +105,16 @@ If your template uses old comment strings it will try to adjust them in the pull
98105

99106
**CAUTION**: Remember to not use default `fetch-depth` for [actions/checkout](https://github.com/actions/checkout) action. Rather set it to `0` - see example below.
100107

101-
## Examples
108+
109+
## 💻 Usage Examples
102110

103111
Red areas show fields that can be dynamically expanded based on commits to the current branch.
104112
Blue areas show fields that can be set in action configuration.
105113

106114
![Example screenshot](https://github.com/devops-infra/action-pull-request/raw/master/action-pull-request.png)
107115

108-
### Simple
116+
117+
### 📝 Basic Example
109118

110119
Create pull request for non-master branches:
111120

@@ -121,13 +130,14 @@ jobs:
121130
- name: Checkout repository
122131
uses: actions/checkout@v4
123132
- name: Create pull request
124-
uses: devops-infra/action-pull-request@v0.6.0
133+
uses: devops-infra/action-pull-request@v0.6
125134
with:
126135
github_token: ${{ secrets.GITHUB_TOKEN }}
127136
title: Automatic pull request
128137
```
129138

130-
### Advanced
139+
140+
### 🔀 Advanced Example
131141

132142
Use first commit as a title and part of body, add a label based on a branch name, add git differences in the template:
133143

@@ -146,7 +156,7 @@ jobs:
146156
fetch-depth: 0
147157
- name: Run the Action
148158
if: startsWith(github.ref, 'refs/heads/feature')
149-
uses: devops-infra/action-pull-request@v0.6.0
159+
uses: devops-infra/action-pull-request@v0.6
150160
with:
151161
github_token: ${{ secrets.GITHUB_TOKEN }}
152162
title: ${{ github.event.commits[0].message }}
@@ -158,24 +168,35 @@ jobs:
158168
get_diff: true
159169
```
160170

161-
## Available images
162171

163-
| Registry | Image |
164-
|----------------------------------------------------------------------------------------|--------------------------------------------|
165-
| [Docker Hub](https://hub.docker.com/repository/docker/devopsinfra/action-pull-request) | `devopsinfra/action-pull-request` |
166-
| [GitHub Packages](https://github.com/devops-infra/action-pull-request/packages) | `ghcr.io/devops-infra/action-pull-request` |
172+
## 🏷️ Version Tags: vX, vX.Y, vX.Y.Z
173+
174+
This action supports three tag levels for flexible versioning:
175+
176+
- **`vX`**: Always points to the latest patch of a major version (e.g., `v1` → `v1.2.3`).
177+
_Benefit: Get all latest fixes for a major version automatically._
178+
179+
- **`vX.Y`**: Always points to the latest patch of a minor version (e.g., `v1.2` → `v1.2.3`).
180+
_Benefit: Stay on a minor version, always up-to-date with bugfixes._
181+
182+
- **`vX.Y.Z`**: Fixed to a specific release (e.g., `v1.2.3`).
183+
_Benefit: Full reproducibility—never changes._
184+
185+
**Use the tag depth that matches your stability needs.**
186+
187+
188+
## 🤝 Contributing
189+
190+
Contributions are welcome! Please feel free to submit a Pull Request. Refer to the [CONTRIBUTING](https://github.com/devops-infra/.github/blob/master/CONTRIBUTING.md) for guidelines.
167191

168-
Following platforms for those images are supported:
169192

170-
| OS | Architecture |
171-
|-------|--------------|
172-
| Linux | `amd64` |
173-
| Linux | `arm64` |
193+
## 📄 License
174194

175-
## Other DevOps-Infra actions
195+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
176196

177-
Check [devops-infra](https://github.com/devops-infra) for other GitHub Actions.
178197

179-
## License
198+
## 💬 Support
180199

181-
[MIT License](LICENSE)
200+
If you have any questions or need help, please:
201+
- 📝 Create an [issue](https://github.com/devops-infra/template-action/issues)
202+
- 🌟 Star this repository if you find it useful!

0 commit comments

Comments
 (0)