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

replace parser with actions/workflow-parser

This commit is contained in:
Casey Lee 2019-01-30 23:14:18 -08:00
parent f6be37b2a2
commit d956aff028
41 changed files with 12740 additions and 633 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,