Increment Version Number of a package

Task Id




This task is used to increment the version number of the package version provided in sfdx-project.json for either an unlocked package or an org based deployment.

Use the version number generated by this task as input to the Create Package tasks, if you want the package number to be incremented during every package build


Install SFDX CLI with sfpowerkit task must be added to the pipeline before utilizing this task

Task Snapshot


Input Parameters
Output Parameters
Control Options
YAML Examples
Input Parameters

Classic Designer Labels are in Bold, YAML Variables are in italics

  • Increment which segment of the version / segment Select the segment of the version number that needs to be incremented Possible Values: BuildNumber, Patch, Minor, Major

  • Set the build segment of the version number to the build number rather than incrementing / appendBuildNumber Check this flag to append the build number rather than incrementing it

  • Set the pipeline's build number to the project' incremented version number / set_build_number Check this flag if the build pipeline's build number is to be updated with the incremented version

  • Name of the package / package The name of the package on which the version will be created Note: If left blank the default package in sfdx-project.json is used

  • SFDX project directory that needs to be deployed / project_directory

    The path to the folder directory containing the sfdx-project.json file. Note: Leave blank if the sfdx-project.json is in the root of the repository

  • Create a commit of incremented sfdx-project.json / commit_changes Check this flag if the incremented version in sfdx-project.json needs to be committed back to the repo Note: This commits but does not push the changes

  • Push incremented version changes to the repository / pushchanges Check this flag to push the incremented version back to the repository. Note: This only supports HTTPS based repository that have a PAT based authentication mechanism. Service Credential based authentication is supported for Github, Github Enterprise and Bitbucket Cloud

The below inputs are enabled only when the "Push Incremented Version changes to the repository" is enabled.

Output Parameters


Control Options


YAML Examples
displayName: Increment Version Number
name: build
segment: 'BuildNumber'
set_build_number: true
package: 'PackageName'
commit_changes: true
pushchanges: true
versionControlProvider: 'azureRepo'


  • 9.0.8 Update Core dependency

  • 9.0.4 Removed collection of telemetry data

  • 8.2.0 Support for version numbers with .NEXT for unlocked packages

  • 8.0.1 Bugfix for Increment Task

  • 8.0.0 Refactored to use revamped folder structure

  • 8.1.2 Fixed #24 Fail to increment for major and minor version numbers

  • 8.0.0 Refactored to use revamped folder structure

  • 5.0.2 Bugfix for #119

  • 5.0.1 Support for appending the build number, rather than incremening it based on the last build number

  • 4.0.0 Support for post increment, push the commited changes to repository

  • 2.0.2 Updated with Telemetry

  • 1.9.0 Initial Version

Edit on GitHub