stefanzweifel / git-auto-commit-action

Automatically commit and push changed files back to GitHub with this GitHub Action for the 80% use case.
MIT License
2.01k stars 228 forks source link

Clarify `commit_author` input option #315

Closed npanuhin closed 9 months ago

npanuhin commented 9 months ago

This section only shows Author <actions@github.com> as an example and never states that the default commit author will be username <username@users.noreply.github.com>. I find this a bit misleading, maybe we should add an actual email address somewhere in the description?

As discussed in #123, clarified the default behavior of commit_author input option and extended the example to include guidance on preserving the original commit author.

- name: Get last commit message
  id: last-commit
  run: |
    echo "message=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT
    echo "author=$(git log -1 --pretty=\"%an <%ae>\")" >> $GITHUB_OUTPUT  # Optional: if you want to preserve the commit author

- uses: stefanzweifel/git-auto-commit-action@vN
  with:
    commit_author: ${{ steps.last-commit.outputs.author }}
    commit_message: ${{ steps.last-commit.outputs.message }}
    commit_options: '--amend --no-edit'
    push_options: '--force'
    skip_fetch: true

Feel free to point out potential changes or improvements)