Skip to content

Commit

Permalink
add example
Browse files Browse the repository at this point in the history
  • Loading branch information
STLVRTX committed Nov 7, 2024
1 parent 00cd32c commit 003b25c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions examples/deployment_pipeline/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package main

import (
"log"

"github.com/iLert/ilert-go/v3"
)

func main() {
var apiToken = "your API token"
client := ilert.NewClient(ilert.WithAPIToken(apiToken))

createDeploymentPipelineInput := &ilert.CreateDeploymentPipelineInput{
DeploymentPipeline: &ilert.DeploymentPipeline{
Name: "example",
IntegrationType: ilert.IntegrationType.GitHub,
Params: &ilert.DeploymentPipelineGitHubParams{
BranchFilters: []string{"main", "master"},
EventFilters: []string{ilert.GitHubEventFilterType.Release},
},
},
}

result, err := client.CreateDeploymentPipeline(createDeploymentPipelineInput)
if err != nil {
log.Println(result)
log.Fatalln("ERROR:", err)
}
log.Printf("Deployment pipeline:\n\n %+v\n", result.DeploymentPipeline)
}

0 comments on commit 003b25c

Please sign in to comment.