Skip to content

Commit 8a1c4aa

Browse files
authored
Merge pull request #53 from tj-actions/feat/switch-to-composite-action
feat: switch to use a composite action
2 parents 16037d0 + 00f80cc commit 8a1c4aa

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

Dockerfile

Lines changed: 0 additions & 9 deletions
This file was deleted.

action.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,31 @@ inputs:
1414
outputs:
1515
release_type:
1616
description: 'The difference between two versions by the release type (major, minor, patch, prerelease, build)'
17+
value: ${{ steps.semver.outputs.release_type }}
1718
new_version:
1819
description: 'The current project version'
20+
value: ${{ steps.semver.outputs.new_version }}
1921
old_version:
2022
description: 'The previous project version'
23+
value: ${{ steps.semver.outputs.old_version }}
2124

2225
runs:
23-
using: 'docker'
24-
image: 'Dockerfile'
26+
using: 'composite'
27+
steps:
28+
- run: |
29+
bash $GITHUB_ACTION_PATH/entrypoint.sh
30+
id: semver
31+
shell: bash
32+
env:
33+
GITHUB_SERVER_URL: ${{ github.server_url }}
34+
GITHUB_REPOSITORY: ${{ github.repository }}
35+
GITHUB_REF: ${{ github.ref }}
36+
GITHUB_EVENT_NAME: ${{ github.event_name }}
37+
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
38+
# https://github.aichem.orgmunity/t/input-variable-name-is-not-available-in-composite-run-steps/127611
39+
INPUT_TOKEN: ${{ inputs.token }}
40+
INPUT_INITIAL_RELEASE_TYPE: ${{ inputs.initial_release_type }}
41+
2542
branding:
2643
icon: copy
2744
color: white

entrypoint.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ if [[ $GITHUB_REF != "refs/tags/"* ]]; then
77
exit 0;
88
fi
99

10-
git remote set-url origin "https://$INPUT_TOKEN@github.com/$GITHUB_REPOSITORY"
11-
1210
git fetch origin +refs/tags/*:refs/tags/*
1311

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

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

2625
echo "::set-output name=release_type::$PART"

0 commit comments

Comments
 (0)