diff --git a/.gitignore b/.gitignore index 79e4fec..42e5806 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ dist/ vendor/ shuttle .shuttle -.idea \ No newline at end of file +.idea +.DS_Store diff --git a/action.yml b/action.yml index 30c9349..c57d003 100644 --- a/action.yml +++ b/action.yml @@ -1,12 +1,14 @@ -name: 'Install Shuttle' -description: 'Installs Lunar Shuttle' +name: "Install Shuttle" +description: "Installs Lunar Shuttle" runs: using: "composite" steps: - run: | + set -e + if [ "$(uname)" == "Darwin" ]; then mkdir -p ~/bin - + if [[ $(uname -m) == 'arm64' ]]; then curl -LO https://github.com/lunarway/shuttle/releases/download/$(curl -Lso /dev/null -w %{url_effective} https://github.com/lunarway/shuttle/releases/latest | awk -F'/' '{print $NF}')/shuttle-darwin-arm64 chmod +x shuttle-darwin-arm64 diff --git a/pkg/git/git.go b/pkg/git/git.go index 6b13982..a08e2bd 100644 --- a/pkg/git/git.go +++ b/pkg/git/git.go @@ -161,7 +161,12 @@ func GetGitPlan( var cloneArg string if parsedGitPlan.Protocol == "https" { - cloneArg = "https://" + parsedGitPlan.Repository + cloneToken := os.Getenv("SHUTTLE_GIT_TOKEN") + if cloneToken == "" { + cloneArg = "https://" + parsedGitPlan.Repository + } else { + cloneArg = fmt.Sprintf("https://%s:%s", cloneToken, parsedGitPlan.Repository) + } } else if parsedGitPlan.Protocol == "ssh" { cloneArg = parsedGitPlan.User + "@" + parsedGitPlan.Repository } else {