Skip to content

When using "Checkout v1", the HEAD is not at the 'GITHUB_SHA' #318

Open
@BrightRan

Description

@BrightRan

Associated community ticket: https://github.community/t/weird-github-sha-on-an-action/125831

The customer setup a workflow runs on pull request event. When executing the action 'Checkout v1' in the workflow,

      - uses: actions/checkout@v1
        with:
          submodules: true

the logs of the checkout action shows:

HEAD is now at 3b3b9b4 Merge 5cae518686005d7cc12968e452105a30a2b94d01 into 4314d1734c365dcb4f8247a6106fb02a896e41f1

but when he print the commit SHA (GITHUB_SHA or github.sha), it is a different one.

GITHUB_SHA=7318c1c8750fde75becae1467aecd22a7678b4ee

A subsequent step runs failed seems is due to this problem, although the checkout step is success.

As I known, when executing checkout, by default the HEAD should be at the 'GITHUB_SHA', unless we specify another commit SHA by using the 'ref' key on the checkout action.
So, in the customer's cause, if the 'GITHUB_SHA' actually is '7318c1c8750fde75becae1467aecd22a7678b4ee', the logs of the checkout should looks like:

HEAD is now at 7318c1c Merge ...

I tested the checkout action with both v1 and v2 on my side, but never reproduced the issue.

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