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
1.97k stars 226 forks source link

Output hash of created commit #171

Closed webignition closed 2 years ago

webignition commented 2 years ago

Is your feature request related to a problem? Please describe. I often need the hash of the commit that has been created, commonly to pass to another workflow to allow a release for the given hash to be created.

Describe the solution you'd like Add a commit_hash output that is populated with the full hash of the commit that was created. This needs only to be present when changes_detected is "true".

Describe alternatives you've considered I often have a step that follows a use of stefanzweifel/git-auto-commit-action with a line that sets the commit hash for subsequent consumption (echo "::set-output name=value::$(git rev-parse HEAD)").

It would be nice for auto-commit-action to expose this for me since knowledge of the hash could somewhat be argued as being the responsibility of the tool that created the commit.

Additional context I've implemented the change in a fork, along with relevant updates to the tests. I will be creating a PR soon.

stefanzweifel commented 2 years ago

Thanks again for your contribution. A new release has been tagged: https://github.com/stefanzweifel/git-auto-commit-action/releases/tag/v4.12.0

If you've been using v4 you automatically get the update.