From 64100534d928200f28a27a3d75b0bbee43dbfb50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Fri, 19 Aug 2022 15:58:19 +0200 Subject: Don't clone the full repo to tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- tagger/tag.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tagger/tag.php b/tagger/tag.php index 9136541..6a449ba 100644 --- a/tagger/tag.php +++ b/tagger/tag.php @@ -74,10 +74,8 @@ foreach($repositories as $repo) { if ($name === 'support' && gethostname() === 'client-builder') { $SSH_OPTIONS = "GIT_SSH_COMMAND='ssh -i ~/.ssh/id_rsa.support-app -o IdentitiesOnly=yes'"; } - // Clone the repository - shell_exec('cd ' . __DIR__ . ' && ' . $SSH_OPTIONS . ' git clone git@github.com:' . $repo . '.git'); - // Checkout the required branch - shell_exec('cd ' . __DIR__ . '/'. $name . ' && git checkout ' . $branch); + // Clone the repository and checkout the required branch + shell_exec('cd ' . __DIR__ . ' && ' . $SSH_OPTIONS . ' git clone --depth=1 --branch="' . $branch . '" https://github.com/' . $repo); // Create a signed tag shell_exec('cd ' . __DIR__ . '/' . $name . ' && git tag -s ' . $tag . ' -m \'' . $tag . '\''); // Push the signed tag -- cgit v1.2.3