# Action<no value>
// <!-- Required for asciidoctor -->
:toc:
// Set toclevels to be at least your hugo [markup.tableOfContents.endLevel] config key
:toclevels: 4

== Description

An Updatecli action defines what happens after a change is detected and validated. While Updatecli's sources find changes (like a new version), and targets define where to apply them (like a file), actions describe what to do next, such as creating a pull request.

An action is bound to an link:/docs/core/scm/[scm] through its `scmid`, and runs when a
link:/docs/core/target/[target] using that same scm pushed a change.
Targets working on the local directory, or on another scm, do not trigger it.

An action is only carried out in `apply` mode with push enabled.
`updatecli pipeline diff`, and `updatecli pipeline apply --push=false`, describe the action that
*would* be taken, including its title and body, without contacting the forge.

NOTE: When none of the related targets changed, Updatecli does not simply skip the action: it still looks for a pull request opened by a previous run, so that an update which became obsolete is reported rather than left dangling.

== Parameters

{{< coreparameters "actions" >}}

=== Title

An action title is optional.
When it is empty, Updatecli falls back to the manifest `name`, which is why a stable `name` matters:
a title built from a source output would rewrite the pull request title on every run.

See link:/docs/core/autodiscovery/[autodiscovery] for how this default applies to generated pipelines.

=== Grouping changes

Actions are grouped by branch, and the branch is derived from the manifest `pipelineid`.
Giving several manifests the same `pipelineid` therefore collects all their changes into a single
branch and a single pull request. See link:/docs/core/configuration/[configuration].

== Examples

In the follow example, we define an action that creates a pull request on GitHub when Updatecli detected outdated version of golangci-lint in GitHub action workflow files. The action uses the `github/pullrequest` plugin to create a pull request with specific labels and `merge.strategy` set to `auto`.

[source,yaml]
----
{{<include "assets/code_example/docs/core/action/updatecli.yaml">}}
----
