Skip to content

Commit 0650ca8

Browse files
committed
Add current and previous version outputs to the GHA
1 parent 88c9790 commit 0650ca8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

action.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ outputs:
1313
bumped:
1414
description: 'Whether there was a bump or not [true|false]'
1515
value: ${{ steps.bump.outputs.bumped }}
16+
previous-version:
17+
description: 'Previous version'
18+
value: ${{ steps.bump.outputs.previous-version }}
19+
current-version:
20+
description: 'Updated version'
21+
value: ${{ steps.bump.outputs.current-version }}
1622
runs:
1723
using: 'composite'
1824
steps:
@@ -39,9 +45,11 @@ runs:
3945
id: bump
4046
shell: bash
4147
run: |
48+
echo "previous-version=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT
49+
4250
bump-my-version bump ${{ inputs.args }}
43-
exitcode="$?"
44-
([[ ${exitcode} -gt 0 ]] && echo "bumped=false" || echo "bumped=true") >> $GITHUB_OUTPUT
51+
([[ $? -gt 0 ]] && echo "bumped=false" || echo "bumped=true") >> $GITHUB_OUTPUT
52+
echo "current-version=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT
4553
- name: Push changes to GitHub
4654
uses: ad-m/github-push-action@master
4755
with:

0 commit comments

Comments
 (0)