Skip to content

Commit 7cabd75

Browse files
committed
feat: add more output information
1 parent 5b0848c commit 7cabd75

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

action.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,20 @@ branding:
77
icon: "git-commit"
88
color: "purple"
99
outputs:
10-
version:
10+
version: # old classic next_version
1111
description: "New version"
12+
next_version:
13+
description: "Next version"
14+
next_version_major:
15+
description: "Only the major version of the next version"
16+
next_version_minor:
17+
description: "Only the minor version of the next version"
18+
previous_version:
19+
description: "Version before the bump"
20+
previous_version_major:
21+
description: "Only the major version of the previous version"
22+
previous_version_minor:
23+
description: "Only the minor version of the previous version"
1224
inputs:
1325
working_directory:
1426
description: "Change to this directory before running"

entrypoint.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ fi
4040

4141
PREV_REV="$(cz version --project)"
4242
echo "PREVIOUS_REVISION=${PREV_REV}" >>"$GITHUB_ENV"
43+
echo "previous_version=${REV}" >>"$GITHUB_OUTPUT"
44+
45+
PREV_REV_MAJOR="$(cz version --project --major)"
46+
echo "PREVIOUS_REVISION_MAJOR=${PREV_REV_MAJOR}" >>"$GITHUB_ENV"
47+
echo "previous_version_major=${REV}" >>"$GITHUB_OUTPUT"
48+
PREV_REV_MINOR="$(cz version --project --minor)"
49+
echo "PREVIOUS_REVISION_MINOR=${PREV_REV_MINOR}" >>"$GITHUB_ENV"
50+
echo "previous_version_minor=${REV}" >>"$GITHUB_OUTPUT"
51+
4352

4453
CZ_CMD=('cz')
4554
if [[ $INPUT_DEBUG == 'true' ]]; then
@@ -102,6 +111,14 @@ if [[ $REV == "$PREV_REV" ]]; then
102111
fi
103112
echo "REVISION=${REV}" >>"$GITHUB_ENV"
104113
echo "version=${REV}" >>"$GITHUB_OUTPUT"
114+
echo "next_version=${REV}" >>"$GITHUB_OUTPUT"
115+
116+
NEXT_REV_MAJOR="$(cz version --project --major)"
117+
echo "NEXT_REVISION_MAJOR=${NEXT_REV_MAJOR}" >>"$GITHUB_ENV"
118+
echo "next_version_major=${REV}" >>"$GITHUB_OUTPUT"
119+
NEXT_REV_MINOR="$(cz version --project --minor)"
120+
echo "NEXT_REVISION_MINOR=${NEXT_REV_MINOR}" >>"$GITHUB_ENV"
121+
echo "next_version_minor=${REV}" >>"$GITHUB_OUTPUT"
105122

106123
GITHUB_DOMAIN=${GITHUB_SERVER_URL#*//}
107124
CURRENT_BRANCH="$(git branch --show-current)"

0 commit comments

Comments
 (0)