You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-20Lines changed: 32 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,28 +4,36 @@
4
4
5
5
## About this project
6
6
7
-
This repository contains a suite of **Composite GitHub Actions** designed to automate semantic version bumping for various project types (Python, Maven, NPM, etc.) within Pull Requests.
7
+
This repository provides a suite of **Composite GitHub Actions** that automate semantic version bumping directly within your Pull Requests. By handling versioning before the merge, it ensures your `main` branch is always clean, versioned, and ready for deployment.
8
+
9
+
## Why use this Action?
10
+
11
+
Most versioning tools run *after* a merge, creating a separate "release commit" that clutters your history and triggers extra CI runs. **Pull Request Semver Bumper** is different:
12
+
13
+
***Bump in PR**: The version bump happens inside the Pull Request. When you merge, the version is already updated. No extra commits, no race conditions.
14
+
***Multi-Language Support**: One unified workflow for **Maven**, **NPM**, **Python**, and generic **Version Files**.
15
+
***Standardized**: Fully compliant with [Conventional Commits](https://www.conventionalcommits.org/). Your commit history becomes your changelog.
8
16
9
17
## Requirements
10
18
11
19
This project relies on the following software and tools:
12
20
13
-
***[GitHub Actions Runner](https://github.com/actions/runner)**: Linux, macOS, or Windows runner.
14
-
***[Git](https://git-scm.com/)**: Version control system.
15
-
***[Node.js](https://nodejs.org/)**: Version 20 or higher (required for the action runtime).
21
+
***[GitHub Actions Runner](https://github.com/actions/runner)**: Linux, macOS, or Windows runner.
22
+
***[Git](https://git-scm.com/)**: Version control system.
23
+
***[Node.js](https://nodejs.org/)**: Version 20 or higher (required for the action runtime).
16
24
17
25
Depending on your project type, you will also need:
18
26
19
-
***[Maven](https://maven.apache.org/)**: For Maven projects (requires `mvn` in the PATH).
20
-
***[NPM](https://www.npmjs.com/)**: For Node.js projects (requires `npm` in the PATH).
21
-
***[Python](https://www.python.org/) & [Poetry](https://python-poetry.org/)**: For Python projects (requires `poetry` in the PATH).
27
+
***[Maven](https://maven.apache.org/)**: For Maven projects (requires `mvn` in the PATH).
28
+
***[NPM](https://www.npmjs.com/)**: For Node.js projects (requires `npm` in the PATH).
29
+
***[Python](https://www.python.org/) & [Poetry](https://python-poetry.org/)**: For Python projects (requires `poetry` in the PATH).
22
30
23
31
## GitHub Marketplace Usage
24
32
25
33
You can use this action directly from the GitHub Marketplace. It supports multiple project types via the `type` input.
| `pyproject-file` | Path to pyproject.toml (python only). | `pyproject.toml` | No |
51
59
| `version-file` | Path to version file (version-file only). | `VERSION` | No |
52
60
53
-
54
-
55
61
## Contributing
56
62
57
63
### Forked Repositories
64
+
58
65
If you are contributing from a forked repository, you **must** run `npm run build` in `.github/actions/core` and commit the changes to the `dist/` folder before pushing.
59
66
The CI workflow cannot automatically push changes to your fork due to GitHub security restrictions.
60
67
61
68
We have included a `pre-commit` hook (using `husky`) that will automatically build and add the `dist` folder when you commit changes in `.github/actions/core`.
62
69
The hook is located in the project root (`.husky/`) and is automatically configured when you run `npm install` in `.github/actions/core`.
* This will also set up the git hooks in the project root.
75
+
2. Make changes.
76
+
3. The pre-commit hook will handle the build.
69
77
70
78
## Core Concepts
71
79
72
80
### 1. Semantic Versioning via PR Titles
81
+
73
82
All actions in this suite rely on [Conventional Commits](https://www.conventionalcommits.org/) to determine the version bump level. The Pull Request title is analyzed to decide whether to perform a major, minor, or patch bump.
74
83
75
84
| PR Title Example | Bump Type | Result Example |
@@ -82,18 +91,20 @@ All actions in this suite rely on [Conventional Commits](https://www.conventiona
82
91
> **⚠️ Important:** If the PR title does not follow the Conventional Commits specification, the action will fail, and no version bump will occur.
83
92
84
93
### 2. Architecture
94
+
85
95
These actions are **Composite Actions** that delegate the heavy lifting to a shared core action (`.github/actions/core`).
86
-
- **Validation:** Checks PR title semantics.
87
-
- **Version Extraction:** Reads the current version from the project file (e.g., `pom.xml`, `package.json`).
88
-
- **Calculation:** Computes the next version based on the PR title.
89
-
- **Execution:** Runs the ecosystem-specific bump command.
90
-
- **Commit & Push:** Commits the change back to the PR branch.
96
+
97
+
* **Validation:** Checks PR title semantics.
98
+
* **Version Extraction:** Reads the current version from the project file (e.g., `pom.xml`, `package.json`).
99
+
* **Calculation:** Computes the next version based on the PR title.
100
+
* **Execution:** Runs the ecosystem-specific bump command.
101
+
* **Commit & Push:** Commits the change back to the PR branch.
91
102
92
103
## Supported Ecosystems
93
104
94
105
Select the action that matches your project type for specific configuration and usage instructions:
95
106
96
-
> **Note:** The "Action Path" listed below is for reference. We recommend using the main Gateway Action (`sap/pull-request-semver-bumper@main`) with the appropriate `type` input.
107
+
> **Note:** The "Action Path" listed below is for reference. We recommend using the Gateway Action (`sap/pull-request-semver-bumper@v1`) with the appropriate `type` input.
97
108
98
109
| Ecosystem | Action Path | Description |
99
110
| :--- | :--- | :--- |
@@ -109,6 +120,7 @@ For detailed documentation on specific ecosystem behaviors, click the links abov
109
120
This project is open to feature requests/suggestions, bug reports etc. via [GitHub issues](https://github.com/SAP/pull-request-semver-bumper/issues). Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](CONTRIBUTING.md).
110
121
111
122
## Security / Disclosure
123
+
112
124
If you find any bug that may be a security problem, please follow our instructions at [in our security policy](https://github.com/SAP/pull-request-semver-bumper/security/policy) on how to report it. Please do not create GitHub issues for security-related doubts or problems.
0 commit comments