Skip to content

Commit

Permalink
Merge pull request #10 from patrickjahns/feature_provide_previous_ver…
Browse files Browse the repository at this point in the history
…sion

feat: provide the current version as output
  • Loading branch information
patrickjahns authored Mar 1, 2020
2 parents b250bcf + 66cb7d0 commit c7bc9ad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
- name: test-output-received
if: github.event_name == 'push'
run: |
if [[ -z "${SEMVER}" ]]; then echo "failed - variable is empty"; exit 1; else echo "success - received ${SEMVER}"; exit 0; fi
if [[ -z "${SEMVER}" ]]; then echo "failed - variable is empty"; exit 1; else echo "success - received ${SEMVER}"; fi
if [[ -z "${CURVER}" ]]; then echo "failed - variable is empty"; exit 1; else echo "success - received ${CURVER}"; fi
env:
SEMVER: ${{ steps.version.outputs.next-version }}
CURVER: ${{ steps.version.outputs.current-version }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ patch-labels: ['semver:patch','bug']

### Output

The action will output the calculated next semantic version as `next-version`
The action will output the calculated next semantic version as `next-version`, as well as the current tag as `current-version`
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ inputs:
required: false

outputs:
current-version:
description: 'The current version/tag'
next-version:
description: 'The calculated next version'
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module.exports = app => {
config
)
log({ app, context, message: 'calculated next version: ' + nextVersion })
core.setOutput('current-version', lastRelease.tag_name)
core.setOutput('next-version', nextVersion)
})
}

0 comments on commit c7bc9ad

Please sign in to comment.