You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+33
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,39 @@ This repository hosts the source code of an automation app to handle the daily a
15
15
16
16
The automation app utilizes the [Probot](https://probot.github.io/) framework and [Octokit](https://docs.github.com/en/rest/using-the-rest-api/libraries-for-the-rest-api?apiVersion=2022-11-28) library to perform user-defined operations on top of the resources within GitHub. See [configs](configs/operations/hello-world.yml) yaml for more information.
17
17
18
+
## Usages
19
+
20
+
### Service
21
+
22
+
A **Service** is an instance of the app that manages and manipulates specific `Resources` while performing defined `Operations`.
23
+
***Resource**: Objects or entities the service will manage or modify, such as GitHub organizations, project, repositories, issues, etc.
24
+
***Operation**: A list of **Tasks** triggered by events with the resources.
25
+
***Task**: Executed sequentially within an **Operation** to perform action, such as create comments, update labels, add issue to project, etc.
26
+
***Call**: The callstack that contains the implementation of the aformentioned task action.
27
+
28
+
### Create a Service
29
+
30
+
To create a service, you need two configuration files:
31
+
***Resource configuration file**: Defines the resources that the service will manage or modify (`configs/resources/sample-resource.yml`).
32
+
***Operation configuration file**: Defines the operations (tasks) that the service will execute with the resources (`configs/resources/sample-operation.yml`).
33
+
34
+
### Start the Service
35
+
36
+
Once you have created the resource and operation configuration files, follow these steps to start the service:
37
+
38
+
1. Set the `RESOURCE_CONFIG` environment variable to the path of the resource configuration YAML file.
39
+
1. Set the `OPERATION_CONFIG` environment variable to the path of the operation configuration YAML file.
When you run the above command, the following takes place:
47
+
1. The app starts a **Service** instance based on the specified configurations.
48
+
1. Retrieves the **[GitHub Context](https://probot.github.io/api/latest/classes/context.Context.html)** (or any other defined context) for all the resources listed in the resource config file.
49
+
1. Registers and listens for events, executes the **Tasks** defined in the operation config. These tasks will be executed sequentially when the corresponding events occur.
50
+
18
51
## Code of Conduct
19
52
20
53
This project has adopted [the Open Source Code of Conduct](CODE_OF_CONDUCT.md).
0 commit comments