Skip to content

Commit 37a7677

Browse files
fix cannot remove registration without gh url (#185)
1 parent f4b7ec2 commit 37a7677

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

runnerconfiguration/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ type RunnerSettings struct {
9696
}
9797

9898
func gitHubAuth(config *ConfigureRemoveRunner, c *http.Client, runnerEvent string, apiEndpoint string, survey Survey) (*protocol.GitHubAuthResult, error) {
99-
if config.URL == "" {
99+
if config.URL == "" && !config.Unattended {
100100
config.URL = survey.GetInput("Which GitHub Url is assosiated with this runner (Normally this isn't missing):", "")
101101
}
102102
registerUrl, err := url.Parse(config.URL)

runnerconfiguration/remove.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ func (config *RemoveRunner) Remove(settings *RunnerSettings, survey Survey, auth
5656
for i, instance := range instancesToRemove {
5757
result := func() error {
5858
confremove := *config
59-
confremove.URL = instance.RegistrationURL
59+
if instance.RegistrationURL != "" {
60+
confremove.URL = instance.RegistrationURL
61+
}
6062
res := auth
6163
if needsPat {
6264
// Enshure that gitHubAuth always uses the Personal access token

0 commit comments

Comments
 (0)