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: docs/plugins.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -422,6 +422,7 @@ When Action Plugins are invoked, they are passed a JSON document on STDIN (compr
422
422
|`type`| String | The [Plugin.type](data.md#plugin-type), which will be set to `action`. |
423
423
|`condition`| String | The [Action.condition](data.md#action-condition) which activated the Plugin. |
424
424
|`params`| Object | If the Plugin defines any parameters, their values will be here. |
425
+
|`secrets`| Object | If the Plugin is assigned any [Secrets](secrets.md), they are included here (as well as in environment variables). |
425
426
| (Other) | Various | Based on context; see below. |
426
427
427
428
If the Action Plugin is being invoked in job-related context (i.e. on job start, job complete, or other job actions) the contents of [JobHookData](data.md#jobhookdata) will also be merged in at the top-level. Similarly, if the plugin is being invoked in an alert-related context (alert fired or cleared), then the contents of [AlertHookData](data.md#alerthookdata) will be merged in.
@@ -436,6 +437,10 @@ Here is an example JSON document sent to an Action Plugin's STDIN as part of a j
436
437
"params": {
437
438
"foo": "Baz"
438
439
},
440
+
"secrets": {
441
+
"DB_USER": "dev",
442
+
"DB_PASS": "1234"
443
+
},
439
444
"job": {
440
445
"id": "jmhzaot10tm",
441
446
"complete": true,
@@ -612,11 +617,14 @@ When your trigger plugin is invoked, it will be passed an array of all the event
612
617
"notes": ""
613
618
}
614
619
}
615
-
]
620
+
],
621
+
"secrets": {}
616
622
}
617
623
```
618
624
619
-
As with all xyOps STDIO communication, the JSON will always have a top-level `xy` property set to `1` (the [xyOps Wire Protocol](xywp.md) version), and a `type` property set to `trigger`. Also present is an `items` array, which will contain an element for each event that has the plugin assigned as a trigger. It is up to your plugin code to decide if each event should launch a job or not. You are also provided some other information about the events:
625
+
As with all xyOps STDIO communication, the JSON will always have a top-level `xy` property set to `1` (the [xyOps Wire Protocol](xywp.md) version), and a `type` property set to `trigger`. If your plugin was assigned any secrets, they will be available in the top-level `secrets` object (and also as environment variables).
626
+
627
+
Also present is an `items` array, which will contain an element for each event that has the plugin assigned as a trigger. It is up to your plugin code to decide if each event should launch a job or not. You are also provided some other information about the events:
0 commit comments