This GitHub Action creates a new version in a Jira project, with the ability to automatically determine the next version number based on existing versions.
The action creates a new version in the specified Jira project by:
- Connecting to Jira using authentication credentials from Vault
- Validating required project key from inputs or environment variables
- Either using a provided version name or automatically determining the next version number
- Creating the new version in the specified Jira project
- Returning the created version's ID and name
This action depends on:
- SonarSource/vault-action-wrapper for retrieving Jira credentials
- SonarSource/release-github-actions/get-jira-version when auto-determining version names
| Input | Description | Required | Default |
|---|---|---|---|
jira-project-key |
The key of the Jira project (e.g., SONARIAC). Can also be set via JIRA_PROJECT_KEY environment variable |
No* | - |
jira-version-name |
The name of the current Jira version. Used to determine the next version if jira-new-version-name is not provided. Can also be set via JIRA_VERSION_NAME environment variable |
No | Auto-determined |
jira-new-version-name |
The name of the new Jira version to create (e.g., 1.2.3). If not provided, the next version will be automatically determined by incrementing the current version | No | Auto-determined |
use-jira-sandbox |
Use the sandbox server instead of the production Jira. Can also be controlled via USE_JIRA_SANDBOX environment variable |
No | - |
*Either the input or corresponding environment variable must be provided for jira-project-key.
| Output | Description |
|---|---|
jira-new-version-id |
The ID of the created Jira version |
jira-new-version-name |
The name of the created Jira version |
- name: Create Jira Version
id: create-version
uses: SonarSource/release-github-actions/create-jira-version@master
with:
jira-project-key: 'SONARIAC'
jira-new-version-name: '1.2.3'
- name: Use created version
run: |
echo "Created version ID: ${{ steps.create-version.outputs.jira-new-version-id }}"
echo "Created version name: ${{ steps.create-version.outputs.jira-new-version-name }}"- name: Create Next Jira Version
id: create-version
uses: SonarSource/release-github-actions/create-jira-version@master
with:
jira-project-key: 'SONARIAC'
# jira-new-version-name is omitted - will auto-increment from current version
- name: Use created version
run: |
echo "Created version: ${{ steps.create-version.outputs.jira-new-version-name }}"- name: Create Jira Version
uses: SonarSource/release-github-actions/create-jira-version@master
env:
JIRA_PROJECT_KEY: 'SONARIAC'
JIRA_VERSION_NAME: '1.2.2' # Current version, will create 1.2.3- name: Create Jira Version in Sandbox
uses: SonarSource/release-github-actions/create-jira-version@master
with:
jira-project-key: 'TESTPROJECT'
jira-new-version-name: '1.0.0-beta'
use-jira-sandbox: 'true'If you have existing versions 1.2.1 and 1.2.2 in your Jira project and don't specify a version name:
- The action will get the latest version (
1.2.2) - Auto-increment to determine the next version (
1.2.3) - Create version
1.2.3in Jira - Return the new version's ID and name
The action uses a Python script that:
- Authenticates with Jira using credentials from HashiCorp Vault
- Validates required project key from inputs or environment variables
- Supports both production and sandbox Jira environments via URL selection
- Can auto-determine the next version number by incrementing the latest existing version
- Creates the new version using the Jira REST API
- Outputs the created version's metadata for use in subsequent steps
- This action requires access to SonarSource's HashiCorp Vault for Jira credentials
- Either
jira-project-keyinput orJIRA_PROJECT_KEYenvironment variable must be provided - When
jira-new-version-nameis not provided, the action automatically determines the next version by incrementing the current version (fromjira-version-nameinput/env or latest existing version) - Input parameters take precedence over environment variables when both are provided
- The action supports both production and sandbox Jira environments
- Version names should follow semantic versioning patterns for best results
- The action will handle existing versions gracefully and return the existing version details