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 80147e8b5b
commit 58731e8d9b
No known key found for this signature in database
GPG key ID: 1899120ECD0A1784

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
}