mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-16 18:01:34 +00:00
fix: short sha has at least four digits (#820)
Refs https://github.com/nektos/act/pull/2540 --- Currently it is not very unlikly to have a false match for tag `0` with sha `0XXXXXXXXXXXXXXXXXXXXXXX`, 1 to 16 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit 4dc67f6ba28f888328a2568bbcacf49e552650da) <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - bug fixes - [PR](https://code.forgejo.org/forgejo/runner/pulls/820): <!--number 820 --><!--line 0 --><!--description Zml4OiBzaG9ydCBzaGEgaGFzIGF0IGxlYXN0IGZvdXIgZGlnaXRz-->fix: short sha has at least four digits<!--description--> <!--end release-notes-assistant--> Co-authored-by: ChristopherHX <christopher.homberger@web.de> Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/820 Reviewed-by: Gusted <gusted@noreply.code.forgejo.org>
This commit is contained in:
parent
e100e3084c
commit
4f883e9707
1 changed files with 1 additions and 1 deletions
|
@ -340,7 +340,7 @@ func NewGitCloneExecutor(input NewGitCloneExecutorInput) common.Executor {
|
|||
logger.Errorf("Unable to resolve %s: %v", input.Ref, err)
|
||||
}
|
||||
|
||||
if hash.String() != input.Ref && strings.HasPrefix(hash.String(), input.Ref) {
|
||||
if hash.String() != input.Ref && len(input.Ref) >= 4 && strings.HasPrefix(hash.String(), input.Ref) {
|
||||
return &Error{
|
||||
err: ErrShortRef,
|
||||
commit: hash.String(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue