This commit is contained in:
parent
d346a15951
commit
b027fab545
2 changed files with 18 additions and 14 deletions
30
main.go
30
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue