Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
e48fc00
ci: Configure semver bumper to explicitly use HEAD as the target tag …
ricogu Dec 4, 2025
b86cdf0
docs: add REUSE status badge to README
ricogu Dec 5, 2025
5e0407b
chore: rename action from "Version Bumping Action" to "pull request s…
ricogu Dec 5, 2025
c00d6e0
chore: Rename action from "pull request semver bumper" to "Version Bu…
ricogu Dec 5, 2025
6d8d069
feat: add GitHub issue templates for bug reports and feature requests.
ricogu Dec 5, 2025
8923a99
Merge branch 'main' into add-meta-info-and-badge
ricogu Dec 5, 2025
339f48e
chore: Add configuration.json to REUSE ignore list.
ricogu Dec 5, 2025
fd2c0a6
Merge branch 'main' of https://github.com/SAP/pull-request-semver-bum…
ricogu Dec 5, 2025
5375a01
Merge remote-tracking branch 'origin/add-meta-info-and-badge' into ad…
ricogu Dec 5, 2025
fb2ede9
docs: update project links in README for consistency
ricogu Dec 5, 2025
79e78af
feat: Add `merge_group` trigger and refine `if` conditions for pull r…
ricogu Dec 5, 2025
e2053ec
chore: Add `CHANGELOG.md` to REUSE ignore list
ricogu Dec 5, 2025
2cbd2b5
docs: Update README examples to use `v1` tag for the version bumping …
ricogu Dec 5, 2025
f4d2052
Remove `merge_group` trigger and redundant `pull_request` event checks.
ricogu Dec 5, 2025
69cddf9
Merge branch 'main' into add-meta-info-and-badge
ricogu Dec 5, 2025
c36ace3
refactor: Remove `merge_group` trigger and simplify pull request cond…
ricogu Dec 5, 2025
8d1068a
docs: add 'Why use this Action?' section, enhance project description…
ricogu Dec 8, 2025
97b58b3
feat: rename core package and action display names to pull-request-se…
ricogu Dec 8, 2025
0ab9ac3
Merge branch 'main' into add-meta-info-and-badge
ricogu Dec 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/core/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "version-bump-action",
"name": "pull-request-semver-bumper-core",
"version": "1.0.0",
"main": "dist/index.js",
"scripts": {
Expand Down
52 changes: 32 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,36 @@

## About this project

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.
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.

## Why use this Action?

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:

* **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.
* **Multi-Language Support**: One unified workflow for **Maven**, **NPM**, **Python**, and generic **Version Files**.
* **Standardized**: Fully compliant with [Conventional Commits](https://www.conventionalcommits.org/). Your commit history becomes your changelog.

## Requirements

This project relies on the following software and tools:

* **[GitHub Actions Runner](https://github.com/actions/runner)**: Linux, macOS, or Windows runner.
* **[Git](https://git-scm.com/)**: Version control system.
* **[Node.js](https://nodejs.org/)**: Version 20 or higher (required for the action runtime).
* **[GitHub Actions Runner](https://github.com/actions/runner)**: Linux, macOS, or Windows runner.
* **[Git](https://git-scm.com/)**: Version control system.
* **[Node.js](https://nodejs.org/)**: Version 20 or higher (required for the action runtime).

Depending on your project type, you will also need:

* **[Maven](https://maven.apache.org/)**: For Maven projects (requires `mvn` in the PATH).
* **[NPM](https://www.npmjs.com/)**: For Node.js projects (requires `npm` in the PATH).
* **[Python](https://www.python.org/) & [Poetry](https://python-poetry.org/)**: For Python projects (requires `poetry` in the PATH).
* **[Maven](https://maven.apache.org/)**: For Maven projects (requires `mvn` in the PATH).
* **[NPM](https://www.npmjs.com/)**: For Node.js projects (requires `npm` in the PATH).
* **[Python](https://www.python.org/) & [Poetry](https://python-poetry.org/)**: For Python projects (requires `poetry` in the PATH).

## GitHub Marketplace Usage

You can use this action directly from the GitHub Marketplace. It supports multiple project types via the `type` input.

```yaml
uses: sap/pull-request-semver-bumper@main
uses: sap/pull-request-semver-bumper@v1
with:
type: 'npm' # Options: npm, maven, python, version-file
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -50,26 +58,27 @@ with:
| `pyproject-file` | Path to pyproject.toml (python only). | `pyproject.toml` | No |
| `version-file` | Path to version file (version-file only). | `VERSION` | No |



## Contributing

### Forked Repositories

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.
The CI workflow cannot automatically push changes to your fork due to GitHub security restrictions.

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`.
The hook is located in the project root (`.husky/`) and is automatically configured when you run `npm install` in `.github/actions/core`.

### Local Development
1. Install dependencies: `cd .github/actions/core && npm install`
* This will also set up the git hooks in the project root.
2. Make changes.
3. The pre-commit hook will handle the build.

1. Install dependencies: `cd .github/actions/core && npm install`
* This will also set up the git hooks in the project root.
2. Make changes.
3. The pre-commit hook will handle the build.

## Core Concepts

### 1. Semantic Versioning via PR Titles

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.

| PR Title Example | Bump Type | Result Example |
Expand All @@ -82,18 +91,20 @@ All actions in this suite rely on [Conventional Commits](https://www.conventiona
> **⚠️ Important:** If the PR title does not follow the Conventional Commits specification, the action will fail, and no version bump will occur.

### 2. Architecture

These actions are **Composite Actions** that delegate the heavy lifting to a shared core action (`.github/actions/core`).
- **Validation:** Checks PR title semantics.
- **Version Extraction:** Reads the current version from the project file (e.g., `pom.xml`, `package.json`).
- **Calculation:** Computes the next version based on the PR title.
- **Execution:** Runs the ecosystem-specific bump command.
- **Commit & Push:** Commits the change back to the PR branch.

* **Validation:** Checks PR title semantics.
* **Version Extraction:** Reads the current version from the project file (e.g., `pom.xml`, `package.json`).
* **Calculation:** Computes the next version based on the PR title.
* **Execution:** Runs the ecosystem-specific bump command.
* **Commit & Push:** Commits the change back to the PR branch.

## Supported Ecosystems

Select the action that matches your project type for specific configuration and usage instructions:

> **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.
> **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.

| Ecosystem | Action Path | Description |
| :--- | :--- | :--- |
Expand All @@ -109,6 +120,7 @@ For detailed documentation on specific ecosystem behaviors, click the links abov
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).

## Security / Disclosure

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.

## Code of Conduct
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Version Bumping Action"
name: "pull-request-semver-bumper"
description: "Automated semantic version bumping for Maven, NPM, Python, and generic projects."
branding:
icon: "git-merge"
Expand Down