Skip to content

Commit 46a2764

Browse files
committed
Fixed timestamp format in inventory JSON.
1 parent 626d64e commit 46a2764

File tree

2 files changed

+22
-24
lines changed

2 files changed

+22
-24
lines changed

.github/workflows/PrepareJob.yml

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -165,56 +165,52 @@ jobs:
165165
ref_kind="branch"
166166
branch="${ref:11}"
167167
168-
printf " Get default branch name ... "
168+
printf "Get default branch name ... "
169169
defaultBranch=$(gh repo view "${{ github.repository }}" --json defaultBranchRef --jq '.defaultBranchRef.name' 2>&1)
170170
if [[ $? -eq 0 ]]; then
171171
printf "${ANSI_LIGHT_GREEN} [OK]\n"
172172
173173
default_branch="${defaultBranch}"
174-
printf " default_branch=%s\n" "${default_branch}"
174+
printf " default_branch=%s\n" "${default_branch}"
175175
else
176176
printf "${ANSI_LIGHT_RED} [FAILED]\n"
177-
printf " %s\n" "${default_branch}"
177+
printf " %s\n" "${default_branch}"
178178
fi
179179
180180
printf "Commit checks:\n"
181+
printf " Commit kind "
182+
if [[ -z "$(git rev-list -1 --merges ${{ github.sha }}~1..${{ github.sha }})" ]]; then
183+
is_regular_commit="true"
184+
printf "${ANSI_LIGHT_YELLOW}[REGULAR]${ANSI_NOCOLOR}\n"
185+
else
186+
is_merge_commit="true"
187+
printf "${ANSI_LIGHT_GREEN}[MERGE]${ANSI_NOCOLOR}\n"
188+
fi
181189
190+
printf "Branch checks:\n"
182191
if [[ "${branch}" == "${defaultBranch}" ]]; then
183192
on_default_branch="true"
184-
185-
printMessage="default branch"
186-
printBranch="${defaultBranch}"
193+
printf " Commit on default branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${defaultBranch}"
187194
fi
188195
189196
if [[ "${branch}" == "${{ inputs.main_branch }}" ]]; then
190197
on_main_branch="true"
191-
192-
printMessage="main branch"
193-
printBranch="${{ inputs.main_branch }}"
198+
printf " Commit on main branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.main_branch }}"
194199
fi
195200
196201
if [[ "${branch}" == "${{ inputs.release_branch }}" ]]; then
197202
on_release_branch="true"
198-
199-
printMessage="release branch"
200-
printBranch="${{ inputs.release_branch }}"
203+
printf " Commit on release branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.release_branch }}"
201204
fi
202205
203206
if [[ "${branch}" == "${{ inputs.development_branch }}" ]]; then
204207
on_dev_branch="true"
205-
206-
printMessage="development branch"
207-
printBranch="${{ inputs.development_branch }}"
208+
printf " Commit on development branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.development_branch }}"
208209
fi
209210
210-
if [[ -z "$(git rev-list -1 --merges ${{ github.sha }}~1..${{ github.sha }})" ]]; then
211-
is_regular_commit="true"
212-
printf " ${ANSI_LIGHT_YELLOW}regular commit${ANSI_NOCOLOR} on ${printMessage} ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${printBranch}"
213-
else
214-
is_merge_commit="true"
215-
printf " ${ANSI_LIGHT_GREEN}merge commit${ANSI_NOCOLOR} on ${printMessage} ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${printBranch}"
216-
217-
printf " Merge kind "
211+
if [[ "${is_merge_commit}" == "true" ]]; then
212+
printf "Release checks:\n"
213+
printf " Release kind "
218214
if [[ "${on_main_branch}" == "true" ]]; then
219215
is_release_commit="true"
220216
printf "${ANSI_LIGHT_GREEN}[RELEASE]${ANSI_NOCOLOR}\n"

.github/workflows/PublishReleaseNotes.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,9 +505,11 @@ jobs:
505505
if [[ $? -eq 0 ]]; then
506506
if [[ -z "${latestVersion}" ]]; then
507507
printf "${ANSI_LIGHT_RED}[UNKNOWN]${ANSI_NOCOLOR}\n"
508+
printf " latest=unknown\n"
508509
latestVersion="unknown"
509510
else
510511
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
512+
printf " latest=%s\n" "${latestVersion}"
511513
fi
512514
else
513515
printf "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}\n"
@@ -529,7 +531,7 @@ jobs:
529531
530532
jsonInventory=$(jq -c -n \
531533
--arg structVersion "${STRUCT_VERSION}" \
532-
--arg date "$(date +"%Y-%m-%dT%H-%M-%S%:z")" \
534+
--arg date "$(date +"%Y-%m-%dT%H:%M:%S%:z")" \
533535
--argjson jsonMeta "$(jq -c -n \
534536
--arg tag "${{ inputs.tag }}" \
535537
--arg version "${{ inputs.inventory-version }}" \

0 commit comments

Comments
 (0)