diff --git a/frontend.go b/frontend.go
index 316dcd6..2d77045 100644
--- a/frontend.go
+++ b/frontend.go
@@ -104,18 +104,25 @@ func resultPage(w http.ResponseWriter, r *http.Request) {
return
}
- var optIn bool
- if strings.ToUpper(r.URL.Query().Get("optin")) == "ON" {
- optIn = true
- }
-
secret := Secret(16)
repo := Repo{
Project: project,
Slug: repo,
Token: accessToken,
Secret: secret,
- OptIn: optIn,
+ }
+
+ // set the repo to opt-in
+ if strings.ToUpper(r.URL.Query().Get("optin")) == "ON" {
+ repo.OptIn = true
+ }
+ // define custom opt-in flag
+ if r.URL.Query().Get("optinFlag") != "" {
+ repo.OptInFlag = r.URL.Query().Get("optinFlag")
+ }
+ // define custom opt-out flag
+ if r.URL.Query().Get("optoutFlag") != "" {
+ repo.OptOutFlag = r.URL.Query().Get("optoutFlag")
}
name := "web"
diff --git a/repo.go b/repo.go
index 2e14d0a..911e73f 100644
--- a/repo.go
+++ b/repo.go
@@ -28,6 +28,8 @@ type Repo struct {
Token string
Secret string
OptIn bool
+ OptInFlag string `gorm:"default:'ci'"`
+ OptOutFlag string `gorm:"default:'ci skip'"`
}
type Repos []Repo
diff --git a/templates/auth.html b/templates/auth.html
index b15865f..27daf07 100644
--- a/templates/auth.html
+++ b/templates/auth.html
@@ -19,11 +19,24 @@
- That would mean that tests are triggered if you specify [ci]
in the PR title, message
+ That would mean that tests are triggered if you specify [ci]
in the PR title, body, commit-message
or if the PR was tagged with ci. If you leave the box unchecked
- tests will be triggered on every pull-request. However you can skip them by writing [ci skip]
in the PR title,
- message or if the PR was tagged with ci skip.
+ tests will be triggered on every pull-request. However you can skip them by using [ci skip]
+ in the mentioned fields or tag it with ci skip.
+