Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions .github/workflows/bump_tag.yml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -36,12 +37,36 @@ jobs:
fetch-depth: 0
token: ${{ secrets.OCF_BOT_PAT_TOKEN }}

- name: Determine version bump type based on branch name
id: bump-type
run: |
# Detect the source branch correctly
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 }}"
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
env:
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 }}
GIT_API_TAGGING: false