Skip to content

Commit

Permalink
address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kilokang committed Apr 4, 2024
1 parent 3896131 commit af3c65d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/self_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,11 @@ jobs:
echo "next-version should have returned v2.0.0" >&2
(( errors++ ))
fi
if [[ "${{ steps.next-version.outputs.major }}" != "v2" ]]; then
if [[ "${{ steps.next-version.outputs.next-major }}" != "v2" ]]; then
echo "next-version should have returned v2.0.0" >&2
(( errors++ ))
fi
if [[ "${{ steps.next-version.outputs.major-minor }}" != "v2.0" ]]; then
if [[ "${{ steps.next-version.outputs.next-major-minor }}" != "v2.0" ]]; then
echo "next-version should have returned v2.0.0" >&2
(( errors++ ))
fi
Expand Down
9 changes: 5 additions & 4 deletions next-version/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🛠️ `next-version`

Compute next version according to changelog.yaml and Semver conventions.
Compute next version according to changelog.yaml and Semver conventions. It will output the major version and the minor too, so it can be used to tag actions and docker images that do not need to be pinned to the whole version but to respect the interface that it has.

## Example Usage

Expand All @@ -12,11 +12,13 @@ Example generating the next version from a repo with version tags with last rele
tag-prefix: my-project-
```
If for example there are breaking changes, the output will be `v2.0.0`
If for example there are breaking changes, the output will be `v2.0.0`, `v2.0`, and `v2`.

## Outputs

`next-version`: Returns Semver next version, with leading v
`next-version`: Returns Semver next version, with leading v. E.g.: `v3.4.1`
`next-version-major`: Returns only the major version, with leading v. E.g.: `v3`
`next-version-major-minor`: Returns major and minor version, with leading v. E.g.: `v3.4`

## Parameters

Expand Down Expand Up @@ -44,4 +46,3 @@ release-toolkit is licensed under the [Apache 2.0](http://apache.org/licenses/LI
## Disclaimer

This tool is provided by New Relic AS IS, without warranty of any kind. New Relic does not guarantee that the tool will: not cause any disruption to services or systems; provide results that are complete or 100% accurate; correct or cure any detected vulnerability; or provide specific remediation advice.

4 changes: 2 additions & 2 deletions src/app/nextversion/nextversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const (

const (
nextVersionOutput = "next-version"
majorOutput = "major"
majorMinorOutput = "major-minor"
majorOutput = "next-major"
majorMinorOutput = "next-major-minor"
)

// Cmd is the cli.Command object for the next-version command.
Expand Down
2 changes: 1 addition & 1 deletion src/app/nextversion/nextversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ changes:
name: "Bumps_Major_GHA",
globalargs: "-gha=true",
args: "-current v1.2.3",
expected: "v2.0.0\n::set-output name=next-version::v2.0.0\n::set-output name=major::v2\n::set-output name=major-minor::v2.0",
expected: "v2.0.0\n::set-output name=next-version::v2.0.0\n::set-output name=next-major::v2\n::set-output name=next-major-minor::v2.0",
yaml: strings.TrimSpace(`
changes:
- type: breaking
Expand Down

0 comments on commit af3c65d

Please sign in to comment.