File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 uses : camunda/infra-global-github-actions/previous-version@32376-previous-version-gha-test
1717 with :
1818 version : ' 1.0.1'
19- verbose : ' true '
19+ verbose : ' false '
2020 - run : |
2121 echo ${{ steps.prev_version.outputs.previous_version }}
2222 echo ${{ steps.prev_version.outputs.release_type }}
Original file line number Diff line number Diff line change 99 required : true
1010 verbose :
1111 description : ' Verbose mode (true|false)'
12- default : ' false'
12+ # default: 'false'
1313outputs :
1414 previous_version :
1515 description : ' Previous version (e.g. 8.7.0)'
4040 set -x
4141 fi
4242
43- RESULT=$(${{ github.action_path }}/previous_version.sh '${{ inputs.version }}')
43+ RESULT=$(${{ github.action_path }}/previous_version.sh '${{ inputs.version }}' "$VERBOSE" )
4444 RELEASE_TYPE=$(echo "$RESULT" | awk '{print $1}')
4545 PREVIOUS_VERSION=$(echo "$RESULT" | awk '{print $2}')
4646 echo "release_type=$RELEASE_TYPE" >> "$GITHUB_OUTPUT"
Original file line number Diff line number Diff line change 1515# E.g. "NORMAL 8.7.0"
1616
1717PREV_TAG=" not found"
18+ VERSION=$1
19+ VERBOSE=$2
20+
21+ if [ " $VERBOSE " = " true" ]; then
22+ set -x
23+ fi
1824
1925 # Function to determine the previous tag using 'NORMAL' logic
2026 determine_normal_prev_tag () {
@@ -147,7 +153,7 @@ get_previous_alpha_tag() {
147153}
148154
149155# validation for tag format
150- if [[ ! $1 =~ ^[0-9]+\. [0-9]+\. [0-9]+ (-alpha[0-9]+ (\. [0-9]+)? )? (-rc[0-9]+)? $ ]]; then
156+ if [[ ! $VERSION =~ ^[0-9]+\. [0-9]+\. [0-9]+ (-alpha[0-9]+ (\. [0-9]+)? )? (-rc[0-9]+)? $ ]]; then
151157 echo " Release tag is invalid"
152158 exit 1
153159fi
@@ -157,11 +163,11 @@ ALPHA_PATTERN='-alpha[0-9]+(\.[0-9]+)?$'
157163RC_PATTERN=' -rc[0-9]+$'
158164
159165TYPE=" "
160- if [[ $1 =~ $NORMAL_PATTERN ]]; then
166+ if [[ $VERSION =~ $NORMAL_PATTERN ]]; then
161167 TYPE=" NORMAL"
162- elif [[ $1 =~ $ALPHA_PATTERN ]]; then
168+ elif [[ $VERSION =~ $ALPHA_PATTERN ]]; then
163169 TYPE=" ALPHA"
164- elif [[ $1 =~ $RC_PATTERN ]]; then
170+ elif [[ $VERSION =~ $RC_PATTERN ]]; then
165171 TYPE=" RC"
166172fi
167173
172178
173179
174180# Determine the previous tag
175- determine_prev_tag " $1 " " $TYPE "
181+ determine_prev_tag " $VERSION " " $TYPE "
176182if [[ -z $PREV_TAG ]]; then
177183 echo " No previous tag found for the given rules"
178184 exit 1
You can’t perform that action at this time.
0 commit comments