Get Project Version from pom.xml
ActionsRetrieves version from from top level project attribute from file in root of project called pom.xml
1.0.0
LatestBy entimaniac
Tags
(1)This action reads the pom.xml
from the root of your project and extracts the project version.
The pom.xml
is expected to look like:
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>com.example</groupId>
<artifactId>wow</artifactId>
<version>2.0.0</version>
...
We can see that the version of this project is 2.0.0
The version of the project.
${{ steps.yourStepIdGoesHere.outputs.version }}
- name: Get Version
uses: ./
id: getVersion
- name: Print the version
run: echo "The version we just got is ${{ steps.getVersion.outputs.version }}"
Get Project Version from pom.xml is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.