Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions Dockerfile

This file was deleted.

21 changes: 19 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,31 @@ inputs:
outputs:
release_type:
description: 'The difference between two versions by the release type (major, minor, patch, prerelease, build)'
value: ${{ steps.semver.outputs.release_type }}
new_version:
description: 'The current project version'
value: ${{ steps.semver.outputs.new_version }}
old_version:
description: 'The previous project version'
value: ${{ steps.semver.outputs.old_version }}

runs:
using: 'docker'
image: 'Dockerfile'
using: 'composite'
steps:
- run: |
bash $GITHUB_ACTION_PATH/entrypoint.sh
id: semver
shell: bash
env:
GITHUB_SERVER_URL: ${{ github.server_url }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_REF: ${{ github.ref }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
# https://github.aichem.orgmunity/t/input-variable-name-is-not-available-in-composite-run-steps/127611
INPUT_TOKEN: ${{ inputs.token }}
INPUT_INITIAL_RELEASE_TYPE: ${{ inputs.initial_release_type }}

branding:
icon: copy
color: white
3 changes: 1 addition & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ if [[ $GITHUB_REF != "refs/tags/"* ]]; then
exit 0;
fi

git remote set-url origin "https://$INPUT_TOKEN@github.com/$GITHUB_REPOSITORY"

git fetch origin +refs/tags/*:refs/tags/*

CURRENT_TAG=${3:-$(git describe --abbrev=0 --tags "$(git rev-list --tags --skip=1 --max-count=1)" || true)}
Expand All @@ -21,6 +19,7 @@ if [[ -z $CURRENT_TAG ]]; then
exit 0;
fi

echo "::debug::Calculating diff..."
PART=$(wget -O - https://raw.github.com/fsaintjacques/semver-tool/3.2.0/src/semver | bash -s diff "${CURRENT_TAG//v/}" "${NEW_TAG//v/}")

echo "::set-output name=release_type::$PART"
Expand Down