pipelines-as-code icon indicating copy to clipboard operation
pipelines-as-code copied to clipboard

Why do not support trigger on pullrequets event when action equal closed ?

Open wuyexixi opened this issue 1 year ago • 4 comments

Is there any special reason PR closed event do not support ?

pipelinesascode.tekton.dev/on-cel-expression: | target_branch == "pipelineascode" && body.pull_request.merged == true

{"level":"info","ts":"2024-01-26T06:37:16.741Z","logger":"pipelinesascode","caller":"adapter/adapter.go:211","msg":"skipping event: pull_request: unsupported action "closed"","commit":"0bd8115","provider":"github","event-id":"5764e830-bc15-11ee-8b09-89324112a5fe"}

wuyexixi avatar Jan 26 '24 06:01 wuyexixi

because we don't handle this event as this needs to be implemented,

chmouel avatar Jan 30 '24 16:01 chmouel

Why not just simply add the closed action in /pipelines-as-code/pkg/provider/github/detect.go

 if provider.Valid(event.GetAction(), []string{"opened", "synchronize", "synchronized", "reopened", "closed"}) {
                        return info.TriggerTypePullRequest, ""
}

wuyexixi avatar Jan 31 '24 09:01 wuyexixi

@chmouel Hello! I was wondering if there is a plan to implement this feature or something similar in the near future. This would be really helpful, especially in cases of garbage collection. Sometimes, we need to run certain tasks when a pull request is closed and we can't replace it with a push event. Thank you!

oleksandr-livewyer avatar Feb 06 '24 16:02 oleksandr-livewyer

this has not been planned atm and unfortunately our backlog is pretty full for the next quarter, but if i get some bandwidth i will see what i can do

chmouel avatar Feb 06 '24 17:02 chmouel