Skip to content

Question: any way to access current branch latest commit? #1944

Open
@kshpytsya

Description

@kshpytsya

As mentioned in #573, the checkout action does all it can to present, during repeated runs, the state of the checked out repo the way it was during the first run. The problem I am trying to solve is to detect whether the commit referenced by GITHUB_SHA is still the latest in the branch being processed, to be able to skip some deployment-like activities. Is there any way to get sha of current latest commit in specific branch without resorting to extra accesses to remote repo? Something like git log -1 --pretty=format:"%H" origin/main doesn't work due to a forced update done by the checkout action.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions