Skip to content

Commit

Permalink
Add in ways to use env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
asheliahut authored and christian-draeger committed Dec 17, 2024
1 parent a430fd3 commit 7c3791f
Showing 1 changed file with 33 additions and 9 deletions.
42 changes: 33 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,39 @@ The incremented version.

## Example usage

- name: Bump release version
id: bump_version
uses: christian-draeger/[email protected]
with:
current-version: '2.11.7-alpha.3' # also accepted: 'v2.11.7-alpha.3' | '2.11.7-alpha3'
version-fragment: 'feature'
- name: Do something with your bumped release version
run: echo ${{ steps.bump_version.outputs.next-version }}
# will print 2.12.0
name: Update Version
on:
workflow_dispatch:

env:
CURRENT_VERSION_TOP_LEVEL: 'v2.11.7-alpha.3'

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Bump release version
id: bump_version
uses: christian-draeger/[email protected]
with:
current-version: ${{ env.CURRENT_VERSION_TOP_LEVEL }} # also accepted: 'v2.11.7-alpha.3' | '2.11.7-alpha3'
version-fragment: 'feature'
- name: Do something with your bumped release version
run: echo ${{ steps.bump_version.outputs.next-version }} # will print 2.12.0
env-set-in-job:
runs-on: ubuntu-latest
steps:
- name: set current version from file
id: set_current_version
run: echo "::set-env name=CURRENT_VERSION::$(cat version.txt)"
- name: Bump release version
id: bump_version
uses: christian-draeger/[email protected]
with:
current-version: ${{ env.CURRENT_VERSION }} # also accepted: 'v2.11.7-alpha.3' | '2.11.7-alpha3'
version-fragment: 'feature'
- name: Do something with your bumped release version
run: echo ${{ steps.bump_version.outputs.next-version }} # will print 2.12.0
## input / output Examples

Expand Down

0 comments on commit 7c3791f

Please sign in to comment.