Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

ci: perform patch bump to get next bump version if auto bump fails (#2684)

Shankar Singh Cca8a850eb641
diff --git a/.github/workflows/release-new-version.yml b/.github/workflows/release-new-version.yml
index 4b29951749..a92cdfb44e 100644
--- a/.github/workflows/release-new-version.yml
+++ b/.github/workflows/release-new-version.yml
@@ -80,14 +80,21 @@ jobs:
shell: bash
# Only consider tags on current branch when setting PREVIOUS_TAG
run: |
- echo "PREVIOUS_TAG=$(git tag --sort='version:refname' --merged | tail --lines 1)" >> $GITHUB_ENV
- echo "NEW_TAG=$(cog bump --auto --dry-run)" >> $GITHUB_ENV
+ PREVIOUS_TAG="$(git tag --sort='version:refname' --merged | tail --lines 1)"
+ if [[ "$(cog bump --auto --dry-run)" == *"No conventional commits for your repository that required a bump"* ]]; then
+ NEW_TAG="$(cog bump --patch --dry-run)"
+ else if [[ "${PREVIOUS_TAG}" != "${NEW_TAG}" ]]
+ NEW_TAG="$(cog bump --auto --dry-run)"
+ fi
+ echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
+ echo "PREVIOUS_TAG=${PREVIOUS_TAG}" >> $GITHUB_ENV
- name: Update changelog and create tag
shell: bash
if: ${{ env.NEW_TAG != env.PREVIOUS_TAG }}
+ # Remove prefix 'v' from 'NEW_TAG' as cog bump --version expects only the version number
run: |
- cog bump --auto
+ cog bump --version ${NEW_TAG#v}
- name: Push created commit and tag
shell: bash