I have a CodeFresh, GitHub pull-request pipeline.
There are 2 scenarios where a PR marks as "Failed", when ideally it would show as "Pending" or no status.
Scenario 1:
When a new event is triggered, it terminates the previous build (as expected)
Build was terminated by pipeline policy - new build triggered by pull-request on branch <my-branch>
This is all great, but the build then shows as "Failed" on GitHub. Theoretically, the new build would undo the "failed" status, but this can take quite some time, and it is difficult to follow what the latest running build is. My terminationPolicy
spec looks like this:
terminationPolicy:
- type: branch
event: onCreate
Termination Policy Docs:
https://codefresh.io/docs/docs/integrations/codefresh-api/?#full-pipeline-specification
Scenario 2:
We want to bypass the build based on labels applied. Ex: "skip-test"
, or be able to run tests without the limitations of the branchRegex
.
steps:
harakiri:
...
commands:
- codefresh terminate ${{CF_BUILD_ID}}
when:
condition:
any:
isWorkInProgress: "match('${{CF_PULL_REQUEST_LABELS}}', 'WIP', false) == true"
Again, works great. But marks the PR as "failed".
If there were a way to inject a command into either of these, I could work with that. But how we have it laid out, it requires entire step to change the status to "Pending". (so I can't simply add an extra "command" to the harakiri
step)
Any thoughts?
question from:
https://stackoverflow.com/questions/65941051/cloudposse-codefresh-pull-request-pipeline-spec-terminate-without-setting 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…