diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml index 921330b..c50bc49 100644 --- a/.github/workflows/example.yml +++ b/.github/workflows/example.yml @@ -3,7 +3,7 @@ on: [push] jobs: my_job: - runs-on: ubuntu-latest + runs-on: stackit-docker steps: - name: Checkout diff --git a/main.go b/main.go index 5562f9b..0989c3a 100644 --- a/main.go +++ b/main.go @@ -14,25 +14,29 @@ func main() { githubactions.Fatalf("Missing input 'project'") } commit := githubactions.GetInput("commit") - if commit == "" { - githubactions.Fatalf("Missing input 'commit'") - } + if commit == "" { + githubactions.Fatalf("Missing input 'commit'") + } branch := githubactions.GetInput("branch") - if branch == "" { - githubactions.Fatalf("Missing input 'branch'") - } + if branch == "" { + githubactions.Fatalf("Missing input 'branch'") + } status := githubactions.GetInput("status") - if status == "" { - githubactions.Fatalf("Missing input 'status'") - } + if status == "" { + githubactions.Fatalf("Missing input 'status'") + } actionid := githubactions.GetInput("actionid") - if actionid == "" { - githubactions.Fatalf("Missing input 'actionid'") - } + if actionid == "" { + githubactions.Fatalf("Missing input 'actionid'") + } webhook := githubactions.GetInput("webhook") if webhook == "" { githubactions.Fatalf("Missing input 'webshook'") } + joburl := githubactions.GetInput("joburl") + if webhook == "" { + githubactions.Fatalf("Missing input 'joburl'") + } fmt.Println("URL:> ", webhook) data := `{ @@ -70,7 +74,7 @@ func main() { } ] }` - var jsonStr = []byte(fmt.Sprintf(data, project, commit, branch, status, actionid )) + var jsonStr = []byte(fmt.Sprintf(data, project, commit, branch, status, actionid)) req, err := http.NewRequest("POST", webhook, bytes.NewBuffer(jsonStr)) if err != nil { panic(err)