extend plugin to publish adaptive card (#1)

* extend plugin to publish adaptive card

* fix template url

* updated template

* fixes issue with template facts not working

* adjust width

* strech column for card

* add data back in

* add sample data
This commit is contained in:
Eoin McAfee
2022-01-25 11:10:33 +00:00
committed by GitHub
parent b9f723b385
commit 23e0e1d500
7 changed files with 282 additions and 4 deletions
+91
View File
@@ -0,0 +1,91 @@
{
"type": "AdaptiveCard",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "Image",
"url": "https://www.kindpng.com/picc/m/356-3561262_free-download-png-and-vector-icon-logo-git.png",
"size": "Small"
}
],
"width": "auto"
},
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"text": "Plugin: Gitleaks",
"wrap": true,
"size": "Small",
"weight": "Bolder",
"isSubtle": false,
"spacing": "Small"
}
],
"width": "stretch"
}
],
"style": "default"
},
{
"type": "ColumnSet",
"style": "default",
"separator": true,
"columns": [
{
"type": "Column",
"items": [
{
"type": "FactSet",
"facts": [
{
"title": "Line:",
"value": "${formatNumber(lineNumber, 0)}"
},
{
"title": "Commit:",
"value": "${commit}"
},
{
"title": "Rule:",
"value": "${rule}"
},
{
"title": "Commit:",
"value": "${commitMessage}"
},
{
"title": "Author:",
"value": "${author}"
},
{
"title": "Email:",
"value": "${email}"
},
{
"title": "File:",
"value": " ${file}"
},
{
"title": "Date:",
"value": "${date}"
}
],
"separator": true,
"$data": "${issues}"
}
],
"width": "stretch"
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.5"
}
View File
+19
View File
@@ -0,0 +1,19 @@
{
"Issues": [{
"line": "*****",
"lineNumber": 12,
"offender": "*****",
"offenderEntropy": -1,
"commit": "e435b441a5c2847340633bd0f84b5eed8e32edcd",
"repo": ".",
"repoURL": "",
"leakURL": "",
"rule": "AWS Access Key",
"commitMessage": "commit message\n",
"author": "Eoin McAfee",
"email": "email@github.com",
"file": ".drone.yml",
"date": "2022-01-24T16:35:57Z",
"tags": "key, AWS"
}]
}