git-commit-id-maven-plugin icon indicating copy to clipboard operation
git-commit-id-maven-plugin copied to clipboard

property git.tags is empty

Open arauchberger opened this issue 3 years ago • 0 comments
trafficstars

Describe the bug

everything works as expected when i build on my local machine. but when i run my maven-builder via github-workflow (triggered by a created tag) the property git.tags is empty.

Steps to Reproduce

  • Please include the full configuration of the plugin
            <plugin>
                <groupId>io.github.git-commit-id</groupId>
                <artifactId>git-commit-id-maven-plugin</artifactId>
                <version>5.0.0</version>
                <executions>
                    <execution>
                        <id>get-the-git-infos</id>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                        <phase>validate</phase>
                    </execution>
                </executions>
                <configuration>
                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
                    <generateGitPropertiesFilename>${project.build.directory}/git.properties</generateGitPropertiesFilename>
                    <skipPoms>false</skipPoms>
                </configuration>
            </plugin>

this is a workflow to reproduce:

name: build-ph2-nightly

on:
  workflow_dispatch:
  push:
    branches:
      - main
    tags:
      - 'testtag'        
  pull_request:
    branches:
      - main
    tags:
      - 'testtag'      

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      #########
      # SETUP
      #########

      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11

      - name: Setup Maven
        uses: stCarolas/setup-maven@v4
        with:
          maven-version: 3.6.3


      #########
      # BUILD
      #########
      
      - name: build
        run: mvn
          -B clean install
          --file myapp/pom.xml

      # DEBUG
      - name: DEBUG 
        run: |
          cat myapp/target/git.properties

Expected behavior

i expect that the git tag been pushed, and triggering the gh-workflow is reflected as the property git.tags

Additional context

For reproducibility please provide the following:

  • the plugin version is being used: 5.0.0
  • the Java-Version is being used: openjdk 11
  • the Maven-Version is being used : Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
  • on what Operating System you experience the bug: Ubuntu 20.04.4 LTS (on GitHub runner)
  • in what context maven is being executed: gh-actions workflow
  • how maven is being executed: mvn clean install

thanks in advance for any support.

arauchberger avatar Apr 08 '22 19:04 arauchberger