From 0650ca8cd4d1a4d155616865ef2cbac39c60c616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Gryta?= Date: Thu, 29 Aug 2024 15:48:04 +0200 Subject: [PATCH] Add current and previous version outputs to the GHA --- action.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index af60ca18..71976e83 100644 --- a/action.yml +++ b/action.yml @@ -13,6 +13,12 @@ outputs: bumped: description: 'Whether there was a bump or not [true|false]' value: ${{ steps.bump.outputs.bumped }} + previous-version: + description: 'Previous version' + value: ${{ steps.bump.outputs.previous-version }} + current-version: + description: 'Updated version' + value: ${{ steps.bump.outputs.current-version }} runs: using: 'composite' steps: @@ -39,9 +45,11 @@ runs: id: bump shell: bash run: | + echo "previous-version=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT + bump-my-version bump ${{ inputs.args }} - exitcode="$?" - ([[ ${exitcode} -gt 0 ]] && echo "bumped=false" || echo "bumped=true") >> $GITHUB_OUTPUT + ([[ $? -gt 0 ]] && echo "bumped=false" || echo "bumped=true") >> $GITHUB_OUTPUT + echo "current-version=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT - name: Push changes to GitHub uses: ad-m/github-push-action@master with: