Skip to content

Commit fe4c913

Browse files
committed
Print Git reference classification.
1 parent e4b5ea3 commit fe4c913

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

.github/workflows/PrepareJob.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ jobs:
153153
pr_number=""
154154
version=""
155155
156+
printf "Classify Git reference '%s' " "${ref}"
156157
if [[ "${ref:0:11}" == "refs/heads/" ]]; then
158+
printf "${ANSI_LIGHT_GREEN}[BRANCH]\n"
157159
ref_kind="branch"
158160
branch="${ref:11}"
159161
@@ -219,6 +221,7 @@ jobs:
219221
printf "commit${ANSI_NOCOLOR} on development branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.development_branch }}"
220222
fi
221223
elif [[ "${ref:0:10}" == "refs/tags/" ]]; then
224+
printf "${ANSI_LIGHT_GREEN}[TAG]\n"
222225
ref_kind="tag"
223226
tag="${ref:10}"
224227
@@ -254,13 +257,15 @@ jobs:
254257
exit 1
255258
fi
256259
elif [[ "${ref:0:10}" == "refs/pull/" ]]; then
260+
printf "${ANSI_LIGHT_YELLOW}[PULL REQUEST]\n"
257261
ref_kind="pullrequest"
258262
pr_number=${ref:11}
259263
pr_number=${pr_number%%/*}
260264
261265
printf "Pull Request check:\n"
262266
printf " Number: %s\n" "${pr_number}"
263267
else
268+
printf "${ANSI_LIGHT_RED}[UNKNOWN]\n"
264269
printf "${ANSI_LIGHT_RED}Unknown Git reference '%s'.${ANSI_NOCOLOR}\n" "${{ github.ref }}"
265270
printf "::error title=Classify Commit::Unknown Git reference '%s'.\n" "${{ github.ref }}"
266271
exit 1

0 commit comments

Comments
 (0)