ValidateContent
Runs validation and linting using the Demisto SDK on content items, such as integrations, automations and content packs. This automation script is used as part of the content validation that runs as part of the contribution flow.
python · Base
Details
| ID | ValidateContent |
|---|---|
| Language | python |
| From Version | 5.5.0 |
| Docker Image | demisto/xsoar-tools:1.0.0.11807991 |
README
Runs validation and linting using the Demisto SDK on content items, such as integrations, automations and content packs.
This automation script is used as part of the content validation that runs as part of the contribution flow.
Script Data
| Name | Description |
|---|---|
| Script Type | python3 |
| Cortex XSOAR Version | 5.5.0 |
Inputs
| Argument Name | Description |
|---|---|
| filename | Name of the file to validate. |
| data | Base64 encoded contents of the file to validate. |
| entry_id | ID of War Room file entry for the ZIP content pack or the integration/automation YAML. |
| use_system_proxy | Use system proxy settings to download required models from GitHub. |
| trust_any_certificate | Trust any certificate (not secure) to download required models from GitHub. |
Outputs
| Path | Description | Type |
|---|---|---|
| ValidationResult.Name | Name of validated item. | String |
| ValidationResult.Error | The validation error message. | String |
| ValidationResult.Line | The code line number in which the error was found in the lint. | String |
| ValidationResult.ErrorCode | The error code or the name of the linter that identified the issue. | String |
Script Example
!ValidateContent entry_id=G2SUaH9ZPmfw7QHWQNk2pa@6
Context Example
"ValidationResult": [
{
"Name": "MyScript",
"Error": "{unterminated string literal (detected at line 166) [syntax]"
"Line": 165,
"Error Code/Linter": "mypy"
},
{
"Name": "MyScript",
"Error": "The following commands contain duplicated arguments:Command example-my-command, contains multiple appearances of the following arguments message.Please make sure to remove the duplications.",
"Error Code/Linter": "IN113"
}
]
}
Human Readable Output
Validation Results
| Name | Error | Line | Error Code/Linter |
|---|---|---|---|
| MyScript | The following commands contain duplicated arguments: Command example-my-command, contains multiple appearances of the following arguments message. Please make sure to remove the duplications. | IN113 | |
| MyScript | unterminated string literal (detected at line 166) [syntax] | 166 | mypy |
commonfields: id: ValidateContent version: -1 name: ValidateContent script: '' type: python subtype: python3 tags: [] comment: Runs validation and linting using the Demisto SDK on content items, such as integrations, automations and content packs. This automation script is used as part of the content validation that runs as part of the contribution flow. enabled: true args: - description: Name of the file to validate. name: filename - description: Base64 encoded contents of the file to validate. name: data - description: ID of War Room file entry for the ZIP content pack or the integration/automation YAML. name: entry_id - name: use_system_proxy auto: PREDEFINED predefined: - yes - no description: Use system proxy settings to download required models from GitHub. defaultValue: yes - name: trust_any_certificate auto: PREDEFINED predefined: - yes - no description: Trust any certificate (not secure) to download required models from GitHub. defaultValue: no outputs: - contextPath: ValidationResult.Name description: Name of validated item. type: String - contextPath: ValidationResult.Error description: The validation error message. type: String - contextPath: ValidationResult.Line description: The line number of the code where the linting error was detected. type: String - contextPath: ValidationResult.ErrorCode description: The error code or the name of the linter that identified the issue. type: String scripttarget: 0 timeout: 600ns runas: DBotWeakRole fromversion: 5.5.0 dockerimage: demisto/xsoar-tools:1.0.0.11807991 tests: - ValidateContent - Test runonce: false