workflow-direct: ignore non-sha1 repos
This commit is contained in:
parent
9ecda0c58b
commit
072d7b4825
@ -106,6 +106,9 @@ func processConfiguredRepositoryAction(action *common.RepositoryWebhookEvent, co
|
|||||||
|
|
||||||
switch action.Action {
|
switch action.Action {
|
||||||
case "created":
|
case "created":
|
||||||
|
if action.Repository.Object_Format_Name != "sha256" {
|
||||||
|
return fmt.Errorf(" - '%s' repo is not sha256. Ignoring.", action.Repository.Name)
|
||||||
|
}
|
||||||
common.PanicOnError(git.GitExec(prjgit, "submodule", "--quiet", "add", "--depth", "1", action.Repository.Clone_Url, action.Repository.Name))
|
common.PanicOnError(git.GitExec(prjgit, "submodule", "--quiet", "add", "--depth", "1", action.Repository.Clone_Url, action.Repository.Name))
|
||||||
if _, err := git.GitBranchHead(path.Join(prjgit, action.Repository.Name), config.Branch); err != nil {
|
if _, err := git.GitBranchHead(path.Join(prjgit, action.Repository.Name), config.Branch); err != nil {
|
||||||
if err := git.GitExec(path.Join(prjgit, action.Repository.Name), "fetch", "--depth", "1", "origin", config.Branch+":"+config.Branch); err != nil {
|
if err := git.GitExec(path.Join(prjgit, action.Repository.Name), "fetch", "--depth", "1", "origin", config.Branch+":"+config.Branch); err != nil {
|
||||||
@ -297,6 +300,13 @@ next_repo:
|
|||||||
log.Println(" -- checking", r.Name)
|
log.Println(" -- checking", r.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if r.ObjectFormatName != "sha256" {
|
||||||
|
if DebugMode {
|
||||||
|
log.Println(" + ", r.ObjectFormatName, ". Needs to be sha256. Ignoring")
|
||||||
|
}
|
||||||
|
continue next_repo
|
||||||
|
}
|
||||||
|
|
||||||
for _, c := range configs {
|
for _, c := range configs {
|
||||||
if c.Organization == orgName && c.GitProjectName == r.Name {
|
if c.Organization == orgName && c.GitProjectName == r.Name {
|
||||||
// ignore project gits
|
// ignore project gits
|
||||||
|
Loading…
x
Reference in New Issue
Block a user