NOTE: While this file will be copied over to any new repository templated off of this repository, its content will be overwritten when a new SecureX Orchestrator (SXO) workflow/atomic action is committed to the repository.
We know plenty of developers who use the description fields in their SXO workflows & atomic actions to describe what the workflow does, how to use it, what inputs to provide, what outputs to expect etc. Developers may also want to make this context available on their Git repositories with the README file for users to view prior to importing workflows/atomic actions into their SXO Org.
AutoDoc creates (and maintains) the README for developers based on a Jinja template, with the content defined in your SXO workflows/atomic actions.
- When creating a new repository to commit your SXO workflows/atomic actions to, select ciscomanagedservices/sxo-autodoc as the repository template
- This will initialize your new repository with the contents of this repository, i.e. with the
.github
folder and aREADME.md
file - In your repository, create a new file called
template.md
within /.github/templates/ and define your Jinja template. More on Jinja syntax here.- For example, you may want to dynamically generate the name of the workflow with each commit, you'd do that by using
{{ workflow['name'] }}
in your template. Similarly, to template workflow descriptions, you'd use{{ workflow['description'] }}
. - Your template can have a mix of static content (text, images, GIFs etc.) and content that you'd like to be dynamically created from your workflow.
- A sample template is also included in the same directory for your reference.
- For example, you may want to dynamically generate the name of the workflow with each commit, you'd do that by using
- No changes are required on SXO for AutoDoc to work. You'd setup the Git Endpoint for your repository on SXO and commit as you typically do.
💡 Pro Tip: Add !#NODOC
to the description of your workflow before you commit to GitHub to tell AutoDoc not to run. When AutoDoc sees !#NODOC
in a workflow's description, it does not update the README with that workflow's content.
AutoDoc uses GitHub Actions to trigger automation with every workflow commit you make. The automation looks at the Jinja template you've pre-defined and the workflow JSONs in the repository to dynamically generate the README content.
Please be aware of pricing & usage limits associated to GitHub Actions.
- Changes to AutoDoc don't push to existing templated repositories
- Need to add support for more keys that can be used in templates than just workflow name & description
Contributors:
- Aman Sardana ([email protected])
- Anant Nambiar ([email protected])
Cisco CX Managed Services - Operate, August 2021