From 158a750a06916a0248ae6eda02690570fb10876f Mon Sep 17 00:00:00 2001 From: AvinashYerra <101195675+AvinashYerra@users.noreply.github.com> Date: Sun, 14 Dec 2025 01:38:06 +0530 Subject: [PATCH 1/6] updated bump_tag yaml file --- .github/workflows/bump_tag.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bump_tag.yml b/.github/workflows/bump_tag.yml index f29adb4..ad6114d 100644 --- a/.github/workflows/bump_tag.yml +++ b/.github/workflows/bump_tag.yml @@ -1,5 +1,6 @@ # Workflow to bump and push the Git tag for a repo # * Use #major/#minor in commit message to bump beyond patch +# * Branches containing "release" automatically trigger minor bump name: Bump Tag @@ -36,6 +37,28 @@ jobs: fetch-depth: 0 token: ${{ secrets.OCF_BOT_PAT_TOKEN }} + # NEW STEP: Determine bump type based on branch name + - name: Determine version bump type + id: bump-type + run: | + # Get the source branch name + if [ "${{ github.event_name }}" == "pull_request" ]; then + BRANCH_NAME="${{ github.event.pull_request.head.ref }}" + else + BRANCH_NAME="${{ github.ref_name }}" + fi + + echo "Branch name: $BRANCH_NAME" + + # Check if branch name contains "release" (case-insensitive) + if echo "$BRANCH_NAME" | grep -iq "release"; then + echo "Branch contains 'release' - setting default bump to minor" + echo "default_bump=minor" >> $GITHUB_OUTPUT + else + echo "Regular branch - keeping default bump as patch" + echo "default_bump=patch" >> $GITHUB_OUTPUT + fi + - name: Bump version and push tag uses: anothrNick/github-tag-action@a2c70ae13a881faf2b4953baaa9e49731997ab36 # v1.67.0 id: tag @@ -43,5 +66,5 @@ jobs: GITHUB_TOKEN: ${{ secrets.OCF_BOT_PAT_TOKEN }} RELEASE_BRANCHES: main WITH_V: true - DEFAULT_BUMP: patch - GIT_API_TAGGING: false + DEFAULT_BUMP: ${{ steps.bump-type.outputs.default_bump }} # CHANGED: Use dynamic default + GIT_API_TAGGING: false \ No newline at end of file From c6830b6cc02e08f11c972796965dffc8b24fc66b Mon Sep 17 00:00:00 2001 From: AvinashYerra <101195675+AvinashYerra@users.noreply.github.com> Date: Sun, 14 Dec 2025 02:30:04 +0530 Subject: [PATCH 2/6] updated yml --- .github/workflows/bump_tag.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/bump_tag.yml b/.github/workflows/bump_tag.yml index ad6114d..5724764 100644 --- a/.github/workflows/bump_tag.yml +++ b/.github/workflows/bump_tag.yml @@ -41,15 +41,15 @@ jobs: - name: Determine version bump type id: bump-type run: | - # Get the source branch name - if [ "${{ github.event_name }}" == "pull_request" ]; then + # Detect the source branch correctly + if [ "${{ github.event_name }}" == "pull_request" ] && [ "${{ github.event.pull_request.merged }}" == "true" ]; then BRANCH_NAME="${{ github.event.pull_request.head.ref }}" else BRANCH_NAME="${{ github.ref_name }}" fi - + echo "Branch name: $BRANCH_NAME" - + # Check if branch name contains "release" (case-insensitive) if echo "$BRANCH_NAME" | grep -iq "release"; then echo "Branch contains 'release' - setting default bump to minor" @@ -57,7 +57,6 @@ jobs: else echo "Regular branch - keeping default bump as patch" echo "default_bump=patch" >> $GITHUB_OUTPUT - fi - name: Bump version and push tag uses: anothrNick/github-tag-action@a2c70ae13a881faf2b4953baaa9e49731997ab36 # v1.67.0 @@ -67,4 +66,4 @@ jobs: RELEASE_BRANCHES: main WITH_V: true DEFAULT_BUMP: ${{ steps.bump-type.outputs.default_bump }} # CHANGED: Use dynamic default - GIT_API_TAGGING: false \ No newline at end of file + GIT_API_TAGGING: false From 9795823d5393c5bebd4451fdd0090841b5b82c29 Mon Sep 17 00:00:00 2001 From: AvinashYerra <101195675+AvinashYerra@users.noreply.github.com> Date: Sun, 14 Dec 2025 02:37:31 +0530 Subject: [PATCH 3/6] yml upd --- .github/workflows/bump_tag.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/bump_tag.yml b/.github/workflows/bump_tag.yml index 5724764..113a10d 100644 --- a/.github/workflows/bump_tag.yml +++ b/.github/workflows/bump_tag.yml @@ -57,6 +57,7 @@ jobs: else echo "Regular branch - keeping default bump as patch" echo "default_bump=patch" >> $GITHUB_OUTPUT + fi - name: Bump version and push tag uses: anothrNick/github-tag-action@a2c70ae13a881faf2b4953baaa9e49731997ab36 # v1.67.0 From d8ad1d599eb4cf8863b152a181e2fed8a7bccb5c Mon Sep 17 00:00:00 2001 From: AvinashYerra <101195675+AvinashYerra@users.noreply.github.com> Date: Sun, 14 Dec 2025 02:40:15 +0530 Subject: [PATCH 4/6] minor --- .github/workflows/bump_tag.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bump_tag.yml b/.github/workflows/bump_tag.yml index 113a10d..9f9c48a 100644 --- a/.github/workflows/bump_tag.yml +++ b/.github/workflows/bump_tag.yml @@ -37,11 +37,11 @@ jobs: fetch-depth: 0 token: ${{ secrets.OCF_BOT_PAT_TOKEN }} - # NEW STEP: Determine bump type based on branch name + # Step: Determine bump type based on branch name - name: Determine version bump type id: bump-type run: | - # Detect the source branch correctly + # Detect the source branch if [ "${{ github.event_name }}" == "pull_request" ] && [ "${{ github.event.pull_request.merged }}" == "true" ]; then BRANCH_NAME="${{ github.event.pull_request.head.ref }}" else @@ -50,7 +50,7 @@ jobs: echo "Branch name: $BRANCH_NAME" - # Check if branch name contains "release" (case-insensitive) + # If branch contains 'release', set minor bump; otherwise patch if echo "$BRANCH_NAME" | grep -iq "release"; then echo "Branch contains 'release' - setting default bump to minor" echo "default_bump=minor" >> $GITHUB_OUTPUT @@ -66,5 +66,5 @@ jobs: GITHUB_TOKEN: ${{ secrets.OCF_BOT_PAT_TOKEN }} RELEASE_BRANCHES: main WITH_V: true - DEFAULT_BUMP: ${{ steps.bump-type.outputs.default_bump }} # CHANGED: Use dynamic default + DEFAULT_BUMP: ${{ steps.bump-type.outputs.default_bump }} # Use dynamic bump from previous step GIT_API_TAGGING: false From 388438e7fe8acac470fe6ba087ad7db270f03ad1 Mon Sep 17 00:00:00 2001 From: AvinashYerra <101195675+AvinashYerra@users.noreply.github.com> Date: Sun, 14 Dec 2025 02:43:23 +0530 Subject: [PATCH 5/6] updated- --- .github/workflows/bump_tag.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bump_tag.yml b/.github/workflows/bump_tag.yml index 9f9c48a..4a490b0 100644 --- a/.github/workflows/bump_tag.yml +++ b/.github/workflows/bump_tag.yml @@ -37,20 +37,19 @@ jobs: fetch-depth: 0 token: ${{ secrets.OCF_BOT_PAT_TOKEN }} - # Step: Determine bump type based on branch name - - name: Determine version bump type + - name: Determine version bump type based on branch name id: bump-type run: | - # Detect the source branch + # Detect the source branch correctly if [ "${{ github.event_name }}" == "pull_request" ] && [ "${{ github.event.pull_request.merged }}" == "true" ]; then BRANCH_NAME="${{ github.event.pull_request.head.ref }}" else BRANCH_NAME="${{ github.ref_name }}" fi - + echo "Branch name: $BRANCH_NAME" - - # If branch contains 'release', set minor bump; otherwise patch + + # Check if branch name contains "release" (case-insensitive) if echo "$BRANCH_NAME" | grep -iq "release"; then echo "Branch contains 'release' - setting default bump to minor" echo "default_bump=minor" >> $GITHUB_OUTPUT @@ -66,5 +65,5 @@ jobs: GITHUB_TOKEN: ${{ secrets.OCF_BOT_PAT_TOKEN }} RELEASE_BRANCHES: main WITH_V: true - DEFAULT_BUMP: ${{ steps.bump-type.outputs.default_bump }} # Use dynamic bump from previous step - GIT_API_TAGGING: false + DEFAULT_BUMP: ${{ steps.bump-type.outputs.default_bump }} + GIT_API_TAGGING: false \ No newline at end of file From 4785666e9f2f8340912d311924094ec64b10a40a Mon Sep 17 00:00:00 2001 From: AvinashYerra <101195675+AvinashYerra@users.noreply.github.com> Date: Sun, 14 Dec 2025 02:45:50 +0530 Subject: [PATCH 6/6] upd --- .github/workflows/bump_tag.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bump_tag.yml b/.github/workflows/bump_tag.yml index 4a490b0..1180415 100644 --- a/.github/workflows/bump_tag.yml +++ b/.github/workflows/bump_tag.yml @@ -41,7 +41,10 @@ jobs: id: bump-type run: | # Detect the source branch correctly - if [ "${{ github.event_name }}" == "pull_request" ] && [ "${{ github.event.pull_request.merged }}" == "true" ]; then + EVENT_NAME="${{ github.event_name }}" + IS_MERGED="${{ github.event.pull_request.merged }}" + + if [[ "$EVENT_NAME" == "pull_request" && "$IS_MERGED" == "true" ]]; then BRANCH_NAME="${{ github.event.pull_request.head.ref }}" else BRANCH_NAME="${{ github.ref_name }}"