From 31c8f33ea2dd3efc2b203f5bbbd6064ab05d9c01 Mon Sep 17 00:00:00 2001 From: Dave Lockhart Date: Mon, 4 Jan 2021 11:46:03 -0500 Subject: [PATCH] adding output parameter --- .github/actions/incremental-release/action.yml | 6 +++++- .github/workflows/release.yml | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/actions/incremental-release/action.yml b/.github/actions/incremental-release/action.yml index 34d2ec6..c2777b2 100644 --- a/.github/actions/incremental-release/action.yml +++ b/.github/actions/incremental-release/action.yml @@ -10,6 +10,10 @@ inputs: GITHUB_TOKEN: description: Token to use to update version in 'package.json' and create the tag required: true +outputs: + VERSION: + description: Version of the new release + value: ${{ steps.increment-version.outputs.version }} runs: using: composite steps: @@ -57,10 +61,10 @@ runs: echo "Executing: \"npm version ${{ steps.determine-increment.outputs.increment }}\"..." NEW_VERSION=$(npm version ${{ steps.determine-increment.outputs.increment }} -m "Updated version to %s [skip ci][skip version]") echo "New version number will be: $NEW_VERSION" - echo "::set-output name=version::$(echo "$NEW_VERSION")" if [ ${{ inputs.DRY_RUN }} == false ]; then echo "Not a dry run, pushing..." + echo "::set-output name=version::$(echo "$NEW_VERSION")" git push --follow-tags --repo=https://${{ inputs.GITHUB_TOKEN }}@github.com/${{ github.repository }} fi shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d5a0a5..3cf52b7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,8 +14,13 @@ jobs: - name: Setup Node uses: Brightspace/third-party-actions@actions/setup-node - name: Release + id: release uses: ./.github/actions/incremental-release with: DRY_RUN: false DEFAULT_INCREMENT: patch GITHUB_TOKEN: ${{ secrets.D2L_GITHUB_TOKEN }} + - name: Post-Release + if: steps.release.outputs.VERSION != '' + run: | + echo "Post-release version was: ${{ steps.release.outputs.VERSION }}"