Skip to content

Commit

Permalink
👮 Support adding a specific clone token (#245)
Browse files Browse the repository at this point in the history
* 👮 Support adding a specific clone token

* 👮 Support adding a specific clone token

* 👮 Support adding a specific clone token
  • Loading branch information
MadsBogeskov authored Sep 16, 2024
1 parent 1859e2d commit 7a4d06d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ dist/
vendor/
shuttle
.shuttle
.idea
.idea
.DS_Store
8 changes: 5 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 6 additions & 1 deletion pkg/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7a4d06d

Please sign in to comment.