Merge pull request #1 from hpehl/patch-1

Add name as an additional output
This commit is contained in:
Andrea Como 2022-09-26 22:03:05 +02:00 committed by GitHub
commit 5681a80312
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -7,6 +7,7 @@ This *GitHub Action* extracts GAV from `pom.xml`, i.e.:
* `groupId` * `groupId`
* `artifactId` * `artifactId`
* `version` * `version`
* `name`
Why should I need this? For example, to **name** and **tag** a Docker image built upon your artifact or **pass as parameters** to a dispatched workflow. Why should I need this? For example, to **name** and **tag** a Docker image built upon your artifact or **pass as parameters** to a dispatched workflow.
@ -27,6 +28,7 @@ This action expects you to have `maven` available in your workflow environment
| `group-id` | Group Id of your project | | `group-id` | Group Id of your project |
| `artifact-id` | Artifact Id of your project | | `artifact-id` | Artifact Id of your project |
| `version` | Version of your project | | `version` | Version of your project |
| `name` | Name of your project |
## Example usage ## Example usage
@ -53,5 +55,6 @@ jobs:
echo ${{ steps.extract.outputs.group-id }} echo ${{ steps.extract.outputs.group-id }}
echo ${{ steps.extract.outputs.artifact-id }} echo ${{ steps.extract.outputs.artifact-id }}
echo ${{ steps.extract.outputs.version }} echo ${{ steps.extract.outputs.version }}
echo ${{ steps.extract.outputs.name }}
shell: bash shell: bash
``` ```

View File

@ -18,6 +18,9 @@ outputs:
version: version:
description: Version description: Version
value: ${{ steps.evaluate.outputs.version }} value: ${{ steps.evaluate.outputs.version }}
name:
description: Name
value: ${{ steps.evaluate.outputs.name }}
runs: runs:
using: 'composite' using: 'composite'
steps: steps:
@ -27,4 +30,5 @@ runs:
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=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=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)" 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)"
echo "::set-output name=name::$(mvn -f ${{ inputs.pom-location }} org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.name -q -DforceStdout)"
shell: bash shell: bash