-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f25d430
commit 9d1e9f0
Showing
4 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
FROM alpine:3.10 | ||
COPY entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,18 @@ | ||
# lerna-get-version-action | ||
Github Action for Retrieving Version from lerna.json | ||
|
||
This GitHub Action retrieves the version from the lerna.json file and sets the version in the `lerna-version` output value usable in your workflow file. | ||
|
||
## Example | ||
|
||
To use this action in your project, use the following: | ||
|
||
```yaml | ||
- name: get-lerna-version | ||
id: lerna-version | ||
uses: saulonunesdev/lerna-get-version-action@master | ||
``` | ||
The Action sets an output variable called `current-version` which can be used in a following step by using `${{ steps.package-version.outputs.lerna-version}}`. | ||
|
||
Based on: https://github.com/martinbeentjes/npm-get-version-action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
name: 'Get current lerna version' | ||
description: 'Get the current version of lerna.json' | ||
branding: | ||
color: 'gray-dark' | ||
icon: 'align-center' | ||
outputs: | ||
lerna-version: | ||
description: 'Current version defined in the lerna.json file' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
#!/bin/sh -l | ||
|
||
LERNA_VERSION=$(grep -m1 version lerna.json | awk -F: '{ print $2 }' | sed 's/[", ]//g') | ||
|
||
echo ::set-output name=lerna-version::$LERNA_VERSION |