ajoberstar/gradle-git-publish

Override commit author

Closed this issue ยท 3 comments

We recently integrated your plugin with GitHub Actions to publish the AssertJ documentation. One tiny side effect is that each commit now appears authored from a runner user which comes from Actions infrastructure, it would be nice to override it with the user who triggered the workflow (see assertj/doc#32).

Is there a way to set the author name and email? An environment property or system property would be ideal, like the grgit auth parameters.

Thanks for these awesome projects ๐Ÿ™‚

Curently there's no way to do this, but will mark it as a future enhancement.

You can also set the global git author informations. At least, the following GitHub Action is working for me ๐Ÿ™‚

...
jobs:
  update-data:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          ssh-key: ${{ secrets.WORKFLOW_SSH_KEY }}
      - uses: webfactory/ssh-agent@v0.3.0
        with:
          ssh-private-key: ${{ secrets.WORKFLOW_SSH_KEY }}
      - name: Set up Java environment
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - name: Set Git author information
        run: |
          git config --global user.name "chkpnt CI"
          git config --global user.email "chkpnt-ci@chkpnt.de"
      - name: Push data, if there are any changes
        run: ./gradlew gitPublishPush --info

No idea why I didn't think about that, thanks for the hint @chkpnt!