1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-11 17:50:58 +00:00

fixes #90 - hard reset when using a version for an action

Signed-off-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
Casey Lee 2020-02-20 20:47:21 -05:00
parent af56d03fab
commit 762d3708fc

View file

@ -258,6 +258,15 @@ func NewGitCloneExecutor(input NewGitCloneExecutorInput) Executor {
return err
}
err = w.Reset(&git.ResetOptions{
Mode: git.HardReset,
Commit: *hash,
})
if err != nil {
logger.Errorf("Unable to reset to %s: %v", hash.String(), err)
return err
}
logger.Debugf("Checked out %s", input.Ref)
return nil
}