Skip to content

Commit a643a04

Browse files
committed
Improved the action documentation
1 parent 1ac64ea commit a643a04

File tree

2 files changed

+41
-5
lines changed

2 files changed

+41
-5
lines changed

config.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ hasChildren = true
8080
url = "core-concept/satellite/http-api"
8181
weight = 5
8282

83+
[[menu.main]]
84+
parent = "Core concepts"
85+
name = "Action"
86+
url = "core-concept/satellite/action"
87+
weight = 6
88+
8389
[[menu.main]]
8490
weight = 3
8591
name = "Features"

content/core-concept/action/index.end.md renamed to content/core-concept/satellite/action/index.end.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ weight: 4
1818
---
1919

2020
> An action is a process that enables a task to be carried out before, during or at the end of the execution of a workflow.
21+
> For example, an action can be used to retrieve or upload files to an SFTP server.
2122
2223
## What is it for?
2324

@@ -37,8 +38,37 @@ At present, actions can only be used within a workflow. It is therefore not curr
3738
workflow:
3839
jobs:
3940
- action: # ...
40-
- pipeline: # ...
41-
- action: # ...
41+
```
42+
43+
We've made sure that you can use your own actions.
44+
45+
You need to implement the `Kiboko\Contract\Action\Interface` and in the `execute` method, you simply write your script.
46+
47+
```php
48+
<?php
49+
50+
namespace App;
51+
52+
final readonly class MyCustomAction implements ActionInterface
53+
{
54+
public function execute(): void
55+
{
56+
// write your script here
57+
}
58+
}
59+
```
60+
61+
Once you've written your action, you need to use it in your Satellite using the custom action plugin like this :
62+
63+
```yaml
64+
workflow:
65+
jobs:
66+
- action:
67+
custom:
68+
use: 'App\MyCustomAction'
69+
services:
70+
App\MyCustomAction:
71+
public: true
4272
```
4373

4474
## Advanced usage
@@ -47,7 +77,7 @@ workflow:
4777

4878
It's possible to use expressions in your pipeline using the `expression_language` option. To use these expressions,
4979
you need to use our customised Providers which provide the different expressions. For more information, please visit
50-
the [detailed documentation](../../feature/expression-language) of the language expressions.
80+
the [detailed documentation](../../../feature/expression-language) of the language expressions.
5181

5282
```yaml
5383
action:
@@ -59,7 +89,7 @@ action:
5989

6090
It's possible to add a `logger` at each action of a workflow.
6191

62-
For more details, go to the [detailed logger documentation](../../feature/logger).
92+
For more details, go to the [detailed logger documentation](../../../feature/logger).
6393

6494
```yaml
6595
satellite:
@@ -81,7 +111,7 @@ satellite:
81111

82112
It's possible to add a `state` at each action of a workflow.
83113

84-
For more details, go to the [detailed state documentation](../../feature/state)
114+
For more details, go to the [detailed state documentation](../../../feature/state)
85115

86116
```yaml
87117
satellite:

0 commit comments

Comments
 (0)