Checkout Action and SHA256 repo

Hello everyone,

I am trying to use the Checkout@v4 on the repo that is SHA256 but somehow under the hood this GiteaAction invokes Git with SHA1 and then fails to perform a checkout.

[command]"C:\Program Files\Git\cmd\git.exe" -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +refs/heads/test_actions*:refs/remotes/origin/test_actions* +refs/tags/test_actions*:refs/tags/test_actions*
fatal: mismatched algorithms: client sha1; server sha256
[31](https:/.../actions/runs/7#jobstep-1-31)The process 'C:\Program Files\Git\cmd\git.exe' failed with exit code 128

Errors:
couldn't find remote ref or fatal: mismatched algorithms: client sha1; server sha256

Exact same flow works on SHA1 repositories but not on SHA256, any ideas if it is just not supported?

1 Like

I ran into the same issue some time ago. Created a SHA256 repository and wanted to use the GitHub checkout action in Gitea.

The problem here is the GitHub checkout action itself. Because the way it works is, that in order to check out your repository it first creates a new empty repository which is always SHA1.

So right now, GitHub checkout action simply can’t be used with SHA256 repositories.

Back then, I managed to rewrite the checkout action to make it work, but I deleted all my work and changes since I’m fine with keep using SHA1 in my repositories.

But as I just took a look in the list of issues I noticed Issue 1843. So I guess it will eventually be fixed.

Yeah, to make it to work we custom-edited the checkout action to support Sha-256. My main complaint is that Gitea allows you to create a Sha256 repo but it does not warns you about issues like this when working with ACT.

I feel that ACT runner doc page should explicitly state that you may face issues trying to deal with Sha256 when using actions.