This Github Action retrieves the pom version from the pom.xml file and sets the version in the version
output value usable in your workflow file.
To use this action in your project, use the following:
- name: get-pom-version
id: pom-version
uses: CptMokoena/maven-get-version-action@master
The Action sets an output variable called version
which can be used in a following step by using ${{ steps.pom-version.outputs.version }}
.
If you are using a monorepo or otherwise have some packages in a subdirectory of your repo, add the path to the package.json
as a parameter:
- name: get-pom-version
id: pom-version
uses: CptMokoena/maven-get-version-action@master
with:
path: mavenproject/<yourproject>