pipelines-as-code
pipelines-as-code copied to clipboard
Trigger PipelineRun on opening/closing PR
Currently PipelinRuns targeting the pull_request event are triggered every time a commit occurs on a pull_request. However, we'd like to be able to trigger a PipelineRun only when a PR is opened or closed and no longer on the commits to the pull request. One way to achieve this behavior is to use GitHub workflows to start the PipelineRun by sending a CURL request (https://pipelinesascode.com/docs/guide/incoming_webhook/). Unfortunately, we can't set the branch name to any name, since the Repository resource doesn't allow wildcards for the incoming target branch name and constantly updating the Repository resource is not favorable.
Would it be possible to either support wildcards for the incoming target branch name in the Repository resource, or to extend the events or cel expressions to include events for opening/closing PRs?
both request are valid!
you can only create a pull request when you have commit in there tho? or did you mean "reopen" a PR ?
No, I meant create a pull request when there is at least one commit in there
ah gotcha, that's an interesting use case... would you mind explaining your workflow on how do you do use this? i will be happy to jump on a call quickly with @koustavsaha if you think it's better explained over the phone
Our workflow is that we want to be able to fire certain PipelineRuns manually, without it being part of an event. These could be things such as more extensive tests that require more resources.
A way to do this is to trigger the webhook using GitHub actions.
But we're unable to have wildcards in the Repository CRD:
incoming:
- targets:
- main
- feature/* <<<
type: webhook-url
Is there something that already caters for this use case?