From 58731e8d9bdb20361f466145edce7d4e587cc03d Mon Sep 17 00:00:00 2001
From: Casey Lee <cplee@nektos.com>
Date: Thu, 20 Feb 2020 20:47:21 -0500
Subject: [PATCH] fixes #90 - hard reset when using a version for an action

Signed-off-by: Casey Lee <cplee@nektos.com>
---
 pkg/common/git.go | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/pkg/common/git.go b/pkg/common/git.go
index c20746d..159141f 100644
--- a/pkg/common/git.go
+++ b/pkg/common/git.go
@@ -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
 	}