diff --git a/action b/action new file mode 100755 index 0000000..41b0ac3 --- /dev/null +++ b/action @@ -0,0 +1,9 @@ +apt update +apt install jq -y +CURRENT_VERSION=$(jq -r .version package.json) +PREVIOUS_VERSIONS=$(git tag -l) + +if [[ $PREVIOUS_VERSIONS =~ (^|[[:space:]])$CURRENT_VERSION($|[[:space:]]) ]]; then + git tag -a -m "Version $(CURRENT_VERSION)" $CURRENT_VERSION + git push --follow-tags +fi \ No newline at end of file diff --git a/action.yaml b/action.yaml index 6b06505..878e1a7 100644 --- a/action.yaml +++ b/action.yaml @@ -9,10 +9,4 @@ runs: using: composite steps: - run: Ensure apt is up-to-date - shell: apt update - - run: Get jq command - shell: apt install jq -y - - run: Get version from package.json - shell: export CURRENT_VERSION=$(jq -r .version package.json) - - run: Get tagged versions from git - shell: export PREVIOUS_VERSIONS=$(git tag -l) + shell: action