First commit
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.idea
|
||||||
38
action.yml
Normal file
38
action.yml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
name: Update node version
|
||||||
|
description: Updates the version inside the package json
|
||||||
|
author: Skydust
|
||||||
|
|
||||||
|
# Define your inputs here.
|
||||||
|
inputs:
|
||||||
|
path:
|
||||||
|
description: The package folder
|
||||||
|
required: false
|
||||||
|
default: "."
|
||||||
|
version:
|
||||||
|
description: The version, not needed most of the time
|
||||||
|
required: false
|
||||||
|
default: "${{ env.NEW_VERSION }}"
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Update package.json
|
||||||
|
run: |
|
||||||
|
log_info "Updating package.json"
|
||||||
|
cd "${{ inputs.path }}"
|
||||||
|
|
||||||
|
log_info "Using version $(yellow)${{ inputs.version }}"
|
||||||
|
|
||||||
|
jq --color-output --arg NEW_VERSION "${{ inputs.version }}" '.version = $NEW_VERSION' package.json > package.json.tmp
|
||||||
|
mv package.json.tmp package.json
|
||||||
|
cat package.json
|
||||||
|
|
||||||
|
if [[ "${{ inputs.version }}" == *-* ]]; then
|
||||||
|
NPM_TAG="sha"
|
||||||
|
else
|
||||||
|
NPM_TAG=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_info "Added tag $(yellow)$NPM_TAG$(reset_color) in env var $(yellow)NPM_TAG"
|
||||||
|
|
||||||
|
echo NPM_TAG=${NPM_TAG} >> $GITEA_ENV
|
||||||
Reference in New Issue
Block a user