From 09405d278ed8ae33d441c15d8cbf713347cde923 Mon Sep 17 00:00:00 2001 From: steiler Date: Mon, 13 Nov 2023 16:42:15 +0100 Subject: [PATCH 1/2] adjust ACLs on Repo Clone --- git/git.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/git/git.go b/git/git.go index 436ff5f7b..46f126a66 100644 --- a/git/git.go +++ b/git/git.go @@ -11,6 +11,7 @@ import ( "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/storage/memory" log "github.com/sirupsen/logrus" + "github.com/srl-labs/containerlab/utils" ) type GoGit struct { @@ -216,6 +217,12 @@ func (g *GoGit) cloneNonExisting() error { } co.ReferenceName = plumbing.NewBranchReferenceName(branchName) } + // pre-create the repo directory and adjust the ACLs + utils.CreateDirectory(g.gitRepo.GetName(), 0755) + err = utils.AdjustFileACLs(g.gitRepo.GetName()) + if err != nil { + log.Warnf("failed to adjust repository (%s) ACLs. continuin anyways", g.gitRepo.GetName()) + } // perform clone g.r, err = gogit.PlainClone(g.gitRepo.GetName(), false, co) From b661cb30a48a1e4823a4c64bca3b501074d77d70 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Wed, 15 Nov 2023 22:59:43 +0200 Subject: [PATCH 2/2] added git dir --- .github/workflows/cicd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 484890fdb..a1630fb9b 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -44,6 +44,7 @@ jobs: - 'errors/**' - 'cert/**' - 'virt/**' + - 'git/**' - 'border0_api/**' - '.github/workflows/cicd.yml' - 'go.mod'