Skip to content

Commit

Permalink
First Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
saulonunesdev committed May 31, 2020
1 parent f25d430 commit 9d1e9f0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
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"]
16 changes: 16 additions & 0 deletions README.md
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
12 changes: 12 additions & 0 deletions action.yml
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'
6 changes: 6 additions & 0 deletions entrypoint.sh
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

0 comments on commit 9d1e9f0

Please sign in to comment.