From c81b8f349858add012a75f2da5a7c2d78d7f37fc Mon Sep 17 00:00:00 2001 From: Paul Hatcherian <1835615+PaulHatch@users.noreply.github.com> Date: Sat, 23 Jan 2021 07:08:00 -0500 Subject: [PATCH] Update documentation --- action.yml | 2 +- readme.md | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index d0111b4..fb67ceb 100644 --- a/action.yml +++ b/action.yml @@ -50,7 +50,7 @@ outputs: version: description: "The version result, in the format {major}.{minor}.{patch}" version_tag: - description: "The version result with trailing zeros removed" + description: "The version tag" changed: description: "Indicates whether there was a change since the last version if change_path was specified. If no change_path was specified this value will always be true since the entire repo is considered." runs: diff --git a/readme.md b/readme.md index 872ccfc..8c8ad01 100644 --- a/readme.md +++ b/readme.md @@ -64,7 +64,7 @@ it will be given the new version if the build were to be retriggered, for exampl ```yaml -- uses: paulhatch/semantic-version@v3.2 +- uses: paulhatch/semantic-version@v3.3 with: # The prefix to use to identify tags branch: "master" @@ -76,7 +76,7 @@ it will be given the new version if the build were to be retriggered, for exampl # Same as above except indicating a minor change, supports regular expressions wrapped with '/' minor_pattern: "(MINOR)" # A string to determine the format of the version output - format: "${major}.${minor}.${patch}-prerelease.${increment}" + format: "${major}.${minor}.${patch}-prerelease${increment}" # Optional path to check for changes. If any changes are detected in the path the # 'changed' output will true. Enter multiple paths separated by spaces. change_path: "src/my-service" @@ -89,6 +89,14 @@ it will be given the new version if the build were to be retriggered, for exampl bump_each_commit: false ``` +## Outputs + +- *major*, *minor*, and *patch* provide the version numbers that have been determined for this commit +- *increment* is an additional value indicating the number of commits for the current version, starting at zero. This can be used as part of a pre-release label. +- *version* is a formatted version string created using the format input. This is a convenience value to provide a preformatted representation of the data generated by this action. +- *version_tag* is a string identifier that would be used to tag the current commit as the "released" version. Typically this would only be used to generate a Git tag name. +- *changed* indicates whether there was a change since the last version if change_path was specified. If no `change_path` was specified this value will always be true since the entire repo is considered. (It is possible to create a commit with no changes, but the Git cli rejects this by default and this case is not considered here) + ## Using Multiple Versions in the Same Repository It is possible to create additional versions for multiple project co-existing @@ -116,12 +124,12 @@ job referencing semantic version multiple times. For example: ```yaml - name: Application Version id: version - uses: paulhatch/semantic-version@v3.2 + uses: paulhatch/semantic-version@v3.3 with: change_path: "src/service" - name: Database Version id: db-version - uses: paulhatch/semantic-version@v3.2 + uses: paulhatch/semantic-version@v3.3 with: major_pattern: "(MAJOR-DB)" minor_pattern: "(MINOR-DB)" @@ -143,3 +151,7 @@ zero to pull the full history and tags. fetch-depth: 0 ``` +## Tips for Getting Started + +- Unless the current commit is already tagged, the version produced by this action will be one value ahead of the last tag. +- There are two types of "version" string, one is the semantic version output that can be used to identify a build and can include prerelease data and metadata specific to the commit such as `v2.0.1-pre001+cf6e75`, the other is the tag version string, which identifies a specific commit as being a specific version. \ No newline at end of file