You can perform certain actions on a pull request based on the status of the CI job triggered on that pull request. Take the following example:
lifecycle:
on_success:
- action: add_labels
labels: ["ci-check-succeeded"]
on_success
indicates that the action has to be executed when the CI Job is completed successfully without any failures. action: add_labels
instructs NeetoCI to add the labels mentioned in the labels
attribute.
Adding the lines from the above example to your config file will add the label ci-check-succeeded
to a pull request whenever a CI Job triggered on that pull request completes successfully without any failures.
Events
You can perform actions for the following events:
on_success
- When the CI Job is completed successfully without any failures.on_trigger
- When a CI Job is triggered.on_running
- When the CI Job starts running.on_failure
- When the CI Job is completed but one of the commands failed.on_error
- When the CI Job was stopped due to some error.
Actions
You can perform the following actions:
-
add_labels
- Adds the specified labels to the pull request. In the example below, the labelsci-check-succeeded
, andready
will be added.- action: add_labels labels: ["ci-check-succeeded", "ready"]
-
remove_labels
- Removes the specified labels to the pull request. In the example below, the labelstests-pending
, andin-progress
will be removed.- action: remove_labels labels: ["tests-pending", "in-progress"]
-
mention_commit_author
- Adds a comment to the pull request starting with a mention to the author of the commit that the CI Job was triggered on. In the example below, a comment@author The CI Checked failed
will be added. @author will be replaced by the username of the author of the commit.- action: mention_commit_author message: "The CI Check failed"