From c7fb8cb2a120cec5ed922571ee3e38523633b0ce Mon Sep 17 00:00:00 2001 From: Sam Davies Date: Tue, 16 Jan 2024 11:03:38 +0700 Subject: [PATCH] Need to mark github directory as safe if we're inside CI Otherwise git doesn't work --- bin/robles | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/robles b/bin/robles index 87cd143..ab1068e 100755 --- a/bin/robles +++ b/bin/robles @@ -4,6 +4,11 @@ APP_PATH = File.expand_path('../config/application', __dir__) require_relative '../config/application' +if GITHUB_WORKSPACE.present? + # Add the workspace as a safe directory to global git if we're inside a GitHub Action + Git.global_config('safe.directory', GITHUB_WORKSPACE) +end + begin RoblesCli.start(ARGV) rescue Exception => e # rubocop:disable Lint/RescueException