replace parser with actions/workflow-parser

This commit is contained in:
Casey Lee
2019-01-30 23:14:18 -08:00
parent 72fbefcedc
commit 5d0a8d26ae
43 changed files with 12749 additions and 634 deletions

View File

@@ -6,7 +6,6 @@ import (
"errors"
"fmt"
"io/ioutil"
"net/url"
"os"
"path"
"path/filepath"
@@ -185,7 +184,7 @@ func findGitDirectory(fromFile string) (string, error) {
// NewGitCloneExecutorInput the input for the NewGitCloneExecutor
type NewGitCloneExecutorInput struct {
URL *url.URL
URL string
Ref string
Dir string
Logger *log.Entry
@@ -195,8 +194,8 @@ type NewGitCloneExecutorInput struct {
// NewGitCloneExecutor creates an executor to clone git repos
func NewGitCloneExecutor(input NewGitCloneExecutorInput) Executor {
return func() error {
input.Logger.Infof("git clone '%s'", input.URL.String())
input.Logger.Debugf(" cloning %s to %s", input.URL.String(), input.Dir)
input.Logger.Infof("git clone '%s'", input.URL)
input.Logger.Debugf(" cloning %s to %s", input.URL, input.Dir)
if input.Dryrun {
return nil
@@ -210,7 +209,7 @@ func NewGitCloneExecutor(input NewGitCloneExecutorInput) Executor {
r, err := git.PlainOpen(input.Dir)
if err != nil {
r, err = git.PlainClone(input.Dir, false, &git.CloneOptions{
URL: input.URL.String(),
URL: input.URL,
Progress: input.Logger.WriterLevel(log.DebugLevel),
ReferenceName: refName,
})
@@ -231,7 +230,7 @@ func NewGitCloneExecutor(input NewGitCloneExecutorInput) Executor {
if err != nil && err.Error() != "already up-to-date" {
input.Logger.Errorf("Unable to pull %s: %v", refName, err)
}
input.Logger.Debugf("Cloned %s to %s", input.URL.String(), input.Dir)
input.Logger.Debugf("Cloned %s to %s", input.URL, input.Dir)
err = w.Checkout(&git.CheckoutOptions{
Branch: refName,