Skip to content

Commit

Permalink
adding output parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
dlockhart committed Jan 4, 2021
1 parent 8ea3056 commit 31c8f33
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/actions/incremental-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"

0 comments on commit 31c8f33

Please sign in to comment.