A GitHub Action to automatically increment version numbers in Gradle build files.
- Supports SNAPSHOT versions
- Can increment major, minor, or patch versions
- Preserves version suffixes
- Simple integration
name: Increment Version
on:
pull_request:
types: [opened, synchronize]
jobs:
increment-version:
runs-on: ubuntu-latest
steps:
# To just add a reminder comment:
- uses: sardul3/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file-path: 'build.gradle'
increment-type: 'patch'
mode: 'comment-only'
# Or to actually update the file:
- uses: sardul3/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file-path: 'build.gradle'
increment-type: 'patch'
mode: 'update-file'| Input | Description | Required | Default |
|---|---|---|---|
github-token |
already present for all workflows | Yes | N/A |
file-path |
Path to the gradle file | Yes | N/A |
increment-type |
Type of increment | Yes | N/A |
| Output | Description |
|---|---|
previous-version |
The version before incrementing |
new-version |
The version after incrementing |
MIT