Skip to content
Merged
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
15 changes: 8 additions & 7 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
# SPDX-FileCopyrightText: 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: Bump Version
# Calling workflow should include "secrets: inherit"
# Reads the contents of the VERSION file, increments the patch version,
# appends '-dev' suffix, writes it back to the VERSION file, and creates a
# pull request with the updated VERSION file.
# Assumes that the VERSION file is in the format: MAJOR.MINOR.PATCH
# Example: 1.2.3 -> 1.2.4-dev
# The calling workflow should include "secrets: inherit" to pass the GITHUB_TOKEN.

on:
workflow_call:
inputs:
version:
required: true
type: string

jobs:
bump-version:
Expand All @@ -20,7 +21,7 @@ jobs:
fetch-depth: 0
- name: increment version
run: |
IFS='.' read -r major minor patch <<< ${{ inputs.version }}
IFS='.' read -r major minor patch <<< $(cat VERSION)
patch_update=$((patch+1))
NEW_VERSION="$major.$minor.$patch_update-dev"
echo $NEW_VERSION > VERSION
Expand All @@ -29,7 +30,7 @@ jobs:
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GH_ONOS_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update version
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
signoff: true
Expand Down