From d6d9c6f7b13fa09e7d455bec896af607baba8d00 Mon Sep 17 00:00:00 2001 From: acomo Date: Sat, 20 Feb 2021 21:53:44 +0100 Subject: [PATCH] First action version --- action.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..6a3dc6b --- /dev/null +++ b/action.yml @@ -0,0 +1,26 @@ +name: 'Maven GAV Extractor' +description: 'Extract Maven grouoId, artifactId and version from pom.xml' +inputs: + pom-location: + description: 'Full path to pom.xml file' + required: true + default: ${{ github.workspace }}/pom.xml +outputs: + group-id: + description: Group Id + value: ${{ steps.evaluate.outputs.group-id }} + artifact-id: + description: Artifact Id + value: ${{ steps.evaluate.outputs.artifact-id }} + version: + description: Version + value: ${{ steps.evaluate.outputs.version }} +runs: + using: 'composite' + steps: + - id: revaluate + run: | + echo "::set-output name=group-id::$(mvn -f ${{ inputs.pom-location }} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.groupId -q -DforceStdout)" + echo "::set-output name=artifact-id::$(mvn -f ${{ inputs.pom-location }} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.artifactId -q -DforceStdout)" + echo "::set-output name=version::$(mvn -f ${{ inputs.pom-location }} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)" + shell: bash \ No newline at end of file