initial code commit

This commit is contained in:
Martin Beentjes
2020-02-12 15:02:30 +01:00
parent fa96d66473
commit b92ec465a3
3 changed files with 17 additions and 0 deletions

3
Dockerfile Normal file
View File

@@ -0,0 +1,3 @@
FROM alpine:3.10
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

9
action.yml Normal file
View File

@@ -0,0 +1,9 @@
name: 'Get current package version'
description: 'Get the current version of the npm package'
outputs:
current-version:
description: 'Current version defined in the package.json file'
runs:
using: 'docker'
image: 'Dockerfile'

5
entrypoint.sh Normal file
View File

@@ -0,0 +1,5 @@
#!/bin/sh -l
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
echo ::set-output name=current-version:$PACKAGE_VERSION