Skip to content

GitHub pull-request workflow - use _expected_ commit hash #671

@nathan-summers-landg

Description

@nathan-summers-landg

Describe the idea (required)

When running a GitHub pull-request workflow, the commit id is not the same as the pushed commit.
https://github.com/orgs/community/discussions/25191

My use-case is when PR changes automatically deploy a micro-service, and I'd like my code to return the build's commit hash in an http response header, so developers and testers can confirm they are testing the right versions of our micro-services.

I believe GitHub expects tools to work around/with GitHubs approach to finding the appropriate commit id. Is this a worthwhile feature to add to git-commit-id-maven-plugin ?

Tell us about the expected behaviour (required)

I am expecting git.commit.id/.full/.abbrev to expose a commit-id that I can correlate with my git history.

During GitHub pull-request worflows, GitHub runs on a 'merge' commit, which is not the pushed commit.
(see https://github.com/orgs/community/discussions/25191)

Context (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions