The full Github Action documentation is available: https://github.com/threatcl/threatcl-action .
This is also where you can see the current version of the action.
validation
A good place to start is validate a folder of threatcl
hcl files, as below:
uses : actions/checkout@v2
- name : threatcl validate
uses : threatcl/threatcl-action@v0.0.1
dashboards
Creating and publishing dashboards is one of the key things you may want to do with threatcl. The below snippet demonstrates three different dashboards:
The default threatcl dashboard templates into markdown
Custom threatcl dashboard templates into markdown
Custom threatcl dashboard templates into html
You can see the full example of this here
uses : actions/checkout@v4
- name : threatcl dashboard
uses : threatcl/threatcl-action@v0.0.2
- name : threatcl custom dashboard
uses : threatcl/threatcl-action@v0.0.2
outdir : ' ./custom-dashboard '
dashboard-template : ' ./templates/dashboard-template.tpl '
threatmodel-template : ' ./templates/threatmodel-template.tpl '
- name : threatcl custom html dashboard
uses : threatcl/threatcl-action@v0.0.2
outdir : ' ./html-dashboard '
dashboard-template : ' ./templates/dashboard-template-html.tpl '
dashboard-filename : ' index '
threatmodel-template : ' ./templates/threatmodel-template-html.tpl '
If you want a step to commit these files back into the repo, you can use something like:
git config --global user.name "threatcl Git Action"
git config --global user.email "yourrepo@users.noreply.github.com"
git add ./html-dashboard/*
git add ./custom-dashboard/*
git commit -m "Automated updated dashboard and export"
For more examples, check out the example repository at https://github.com/threatcl/threatcl-action-example/actions