mirror of
https://github.com/martinbeentjes/npm-get-version-action.git
synced 2025-12-06 07:38:05 +08:00
initial code commit
This commit is contained in:
3
Dockerfile
Normal file
3
Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
||||
FROM alpine:3.10
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
9
action.yml
Normal file
9
action.yml
Normal 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
5
entrypoint.sh
Normal 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
|
||||
Reference in New Issue
Block a user