Upgrading @v1.2 -> @v2 can no longer specify short sha in ref
See original GitHub issuewhen upgrading to @v2 or later it no longer accepts a single short sha for the ref parameter, and the git command fails:
Setup
uses: actions/checkout@v2.2.0
with:
ref: 7daa143
Output:
/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=5 origin +refs/heads/7daa143*:refs/remotes/origin/7daa143* +refs/tags/7daa143*:refs/tags/7daa143*
The process '/usr/bin/git' failed with exit code 1
Waiting 18 seconds before trying again
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:8
Top Results From Across the Web
Git References - Git SCM
When you run git commit , it creates the commit object, specifying the parent of that commit object to be whatever SHA-1 value...
Read more >The unauthenticated git protocol on port 9418 is no longer ...
First, this error message is indeed expected on Jan. 11th, 2022. See "Improving Git protocol security on GitHub".
Read more >Commits API - GitLab Docs
An array of action hashes to commit as a batch. See the next table for what attributes it can take. author_email, string, no,...
Read more >Module Sources | Terraform - HashiCorp Developer
Note that Terraform does not consider an absolute filesystem path (starting ... source = "git::https://example.com/vpc.git?ref=v1.2.0" } # directly select a ...
Read more >The Difference Between SHA-1, SHA-2 and SHA-256 Hash ...
Note that a large bit-length does not automatically mean a hashing algorithm produces more secure hashes. The construction of the algorithm is also...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Adding some more info here.
I have a set of steps like:
That resu
This ends up trying to issue the command:
Notice that the short ref is being quoted in the command. I don’t know if that matters or not, but it’s definitely failing. Switching back to
@v1
works.tnx, fetch-depth: 0 doesn’t make any difference, just got a different error. but full sha works. Seems the checkout command it generates assumes it’s a branch or tag when it’s a short hash (7 chars) and thereafter generates an invalid checkout command
With a full sha it generrates this checkout command - same as it should be if a short sha had been treated the same /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +7daa1431d70a06da41e2da7f2ade272bee3d56ca:refs/remotes/pull/515/merge