···
67
+
type PushOptions struct {
func (h *InternalHandle) PostReceiveHook(w http.ResponseWriter, r *http.Request) {
l := h.l.With("handler", "PostReceiveHook")
···
97
+
// extract any push options
98
+
pushOptionsRaw := r.Header.Values("X-Git-Push-Option")
99
+
pushOptions := PushOptions{}
100
+
for _, option := range pushOptionsRaw {
101
+
if option == "skip-ci" || option == "ci-skip" {
102
+
pushOptions.skipCi = true
for _, line := range lines {
err := h.insertRefUpdate(line, gitUserDid, repoDid, repoName)
···
100
-
err = h.triggerPipeline(line, gitUserDid, repoDid, repoName)
113
+
err = h.triggerPipeline(line, gitUserDid, repoDid, repoName, pushOptions)
l.Error("failed to trigger pipeline", "err", err, "line", line, "did", gitUserDid, "repo", gitRelativeDir)
···
return h.db.InsertEvent(event, h.n)
151
-
func (h *InternalHandle) triggerPipeline(line git.PostReceiveLine, gitUserDid, repoDid, repoName string) error {
164
+
func (h *InternalHandle) triggerPipeline(line git.PostReceiveLine, gitUserDid, repoDid, repoName string, pushOptions PushOptions) error {
165
+
if pushOptions.skipCi {
didSlashRepo, err := securejoin.SecureJoin(repoDid, repoName)