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