CTO.ai Github Action
ActionsTags
(1)This Github Action allows you to extend the insights data received by CTO.ai Github App. You can add data to you workflows for deployment tools that are not configured with Github's deployment API.
CTO.ai api token, follow these docs to generate
CTO.ai team ID sending the data, follow these docs to access
Name of event being sent i.e. "deployment"
Action associated with event i.e. "failed", "pending", or "succeeded"
The following action fields are optional; however, more complex builds may require them.
The branch
field refers to the git branch name where the change occurs. When
absent, the action will use the ref
value if available to the event type.
The commit
field refers to the commit id where the change occurs. When absent,
the action will use the SHA value if available to the event type.
The repo
field refers to the repository name where the change occurs. When
absent, the action will use the repository's name where the workflow runs.
The environment
field refers to the environment in which the workflow is running.
The image
field refers to the OCI image name or ID associated with this event.
Create 2 new secrets for your token
and team_id
to be passed into the action.
- From your GitHub repo, click Settings -> Secrets -> New Secret
- Create
CTOAI_TEAM_ID
secret using your CTO.ai-issued Team Id. - Create
CTOAI_EVENTS_API_TOKEN
secret using your CTO.ai-issued API Token.
If you have a GitHub workflow that deploys your application (i.e. serverless, npm publish, Azure, etc), you can drop this Action in right after that step to capture the success or fail of that deployment!
We recommend adding environment
to help us help you differentiate multiple deployment events from the same repository to different environments or workflows. This will be reflected on your Insights Dashboard.
- name: Report Deployment Succeeded
if: ${{ success() }}
uses: cto-ai/action@v1
with:
team_id: ${{ secrets.CTOAI_TEAM_ID }}
token: ${{ secrets.CTOAI_EVENTS_API_TOKEN }}
event_name: "deployment"
event_action: "succeeded"
environment: "production"
- name: Report Deployment Failed
if: ${{ failure() }}
uses: cto-ai/action@v1
with:
team_id: ${{ secrets.CTOAI_TEAM_ID }}
token: ${{ secrets.CTOAI_EVENTS_API_TOKEN }}
event_name: "deployment"
event_action: "failed"
environment: "production"
CTO.ai Github Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.