From 11e9483e4a254fe36c8360959c1f25e47d6da47c Mon Sep 17 00:00:00 2001 From: Felipe Rios Date: Mon, 4 Dec 2023 17:45:19 -0500 Subject: [PATCH] hotfix(release): corrected release variables to have more readability Signed-off-by: Felipe Rios --- azure-devops/global/stages/40-delivery/release.yaml | 8 +++++--- gitlab/global/stages/40-delivery/release.yaml | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/azure-devops/global/stages/40-delivery/release.yaml b/azure-devops/global/stages/40-delivery/release.yaml index 959a33fd..761de45e 100644 --- a/azure-devops/global/stages/40-delivery/release.yaml +++ b/azure-devops/global/stages/40-delivery/release.yaml @@ -1,12 +1,14 @@ jobs: - job: 'release' - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'), contains(variables['Build.SourceVersionMessage'], 'origin/chore/bump-')) + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'), or(contains(variables['Build.SourceVersionMessage'], 'origin/chore/bump-'), contains(variables['Build.SourceVersionMessage'], 'chore(bump)'))) steps: - script: | set -eux COMMIT_MESSAGE="$(git log -1 --pretty=%B)" - if echo -n "$COMMIT_MESSAGE" | grep -Eq "^Merge (remote-tracking|remote|tracking)? ?branch '(origin\/)?chore\/bump-([0-9]+\.[0-9]+\.[0-9]+)'.*$"; then - VERSION=$(echo "$COMMIT_MESSAGE" | sed -En "s/^Merge.*branch '(origin\/)?chore\/bump-([^']+)'.*$/\2/p") + REGEX="^Merge (remote-tracking|remote|tracking)? ?branch '(origin\/)?chore\/bump-([0-9]+\.[0-9]+\.[0-9]+)'.*|.*chore\(bump\) *.* to ([0-9]+\.[0-9]+\.[0-9]+)$" + + if echo -n "$COMMIT_MESSAGE" | grep -Eq "$REGEX"; then + VERSION=$(echo "$COMMIT_MESSAGE" | sed -En "s/$REGEX/\3\4/p") RELEASE_NOTES="" if [ -f CHANGELOG.md ]; then diff --git a/gitlab/global/stages/40-delivery/release.yaml b/gitlab/global/stages/40-delivery/release.yaml index 963a6d9d..8fe54f0b 100644 --- a/gitlab/global/stages/40-delivery/release.yaml +++ b/gitlab/global/stages/40-delivery/release.yaml @@ -6,8 +6,10 @@ release: script: - | set -eux - if echo "$CI_COMMIT_MESSAGE" | grep -Eq "^Merge (remote-tracking|remote|tracking)? ?branch '(origin\/)?chore\/bump-([0-9]+\.[0-9]+\.[0-9]+)'.*$"; then - VERSION=$(echo "$CI_COMMIT_MESSAGE" | sed -En "s/^Merge.*branch '(origin\/)?chore\/bump-([^']+)'.*$/\2/p") + REGEX="^Merge (remote-tracking|remote|tracking)? ?branch '(origin\/)?chore\/bump-([0-9]+\.[0-9]+\.[0-9]+)'.*$" + + if echo "$CI_COMMIT_MESSAGE" | grep -Eq "$REGEX"; then + VERSION=$(echo "$CI_COMMIT_MESSAGE" | sed -En "s/$REGEX/\3/p") RELEASE_NOTES="" if [ -f CHANGELOG.md ]; then