https://github.com/julbme/gh-action-semver-build-vars
GitHub actions to compute Semver release vars
https://github.com/julbme/gh-action-semver-build-vars
build ci github-actions semver
Last synced: 26 days ago
JSON representation
GitHub actions to compute Semver release vars
- Host: GitHub
- URL: https://github.com/julbme/gh-action-semver-build-vars
- Owner: julbme
- License: mit
- Created: 2022-03-08T15:38:26.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-03T21:02:57.000Z (over 3 years ago)
- Last Synced: 2025-01-22T09:16:54.914Z (over 1 year ago)
- Topics: build, ci, github-actions, semver
- Language: Java
- Homepage: https://julbme.github.io/gh-action-semver-build-vars/
- Size: 607 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/julbme/gh-action-semver-build-vars/actions/workflows/maven-build.yml)
[](https://github.com/julbme/gh-action-semver-build-vars/actions/workflows/commitlint.yml)
[](https://sonarcloud.io/summary/new_code?id=julbme_gh-action-semver-build-vars)

# GitHub Action to compute SemVer release vars
The GitHub Action for computing SemVer build vars.
## Usage
### Example Workflow file
```yaml
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Merge branch
uses: julbme/gh-action-semver-build-vars@v1
with:
package_version: 1.0.0-SNAPSHOT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
### Inputs
| Name | Type | Default | Description |
|-------------------|--------|---------|---------------------------------------------------------------------------|
| `package_version` | string | ` ` | The build version as set by package manager's file in the current branch. |
### Outputs
| Name | Type | Description |
|-------------------------------------|--------|--------------------------------------------------------------------------------------------------------------|
| `original_version` | string | The original build version. Ex: `1.0.0-SNAPSHOT` |
| `version` | string | The build version. Ex: `1.0.0-unstable` |
| `sha_build_version` | string | The version with the abbreviated sha as build token. Ex: `1.0.0-unstable+abcdef` |
| `sha_build_version_build` | string | The abbreviated sha. Ex: `abcdef` |
| `timestamp_build_version` | string | The version with the UTC timestamp as build token. Ex: `1.0.0-unstable+20220317160716` |
| `timestamp_build_version_build` | string | The UTC timestamp. Ex: `20220317160716` |
| `timestamp_sha_build_version` | string | The version with the UTC timestamp and the SHA as build token. Ex: `1.0.0-unstable+20220317160716.abcdef` |
| `timestamp_sha_build_version_build` | string | The UTC timestamp and the SHA. Ex: `20220317160716.abcdef` |
| `docker_tag` | string | The docker tag. Ex: `1.0.0-unstable` |
| `docker_sha_build_tag` | string | The docker tag with the abbreviated sha as build token. Ex: `1.0.0-unstable+abcdef` |
| `docker_timestamp_build_tag` | string | The docker tag with the UTC timestamp as build token. Ex: `1.0.0-unstable+20220317160716` |
| `docker_timestamp_sha_build_tag` | string | The docker tag with the UTC timestamp and the SHA as build token. Ex: `1.0.0-unstable+20220317160716.abcdef` |
## Contributing
This project is totally open source and contributors are welcome.