Skip to main content

Github Action

Github Acion allows you to invoke GitHub workflows from the playbooks.

note

You must configure your GitHub Actions workflow to run when the workflow_dispatch webhook event occurs

invoke-release-workflow.yaml
---
apiVersion: mission-control.flanksource.com/v1
kind: Playbook
metadata:
name: invoke-release-workflow
namespace: default
spec:
parameters:
- name: repo
label: Repository
description: The name of the repository without the .git extension
default: duty
- name: branch
label: Branch to run the workflow on
default: main
- name: environment
label: Environment to run tests against
default: production
type: text
- name: logLevel
label: Log level
type: list
properties:
options:
- label: info
value: info
- label: warning
value: warning
- label: error
value: error
default: warning
- name: tags
label: Should tag or not
type: checkbox
default: 'false'
actions:
- name: Invoke github workflow
github:
username: flanksource
repo: '{{.params.repo}}'
token:
valueFrom:
secretKeyRef:
name: github
key: token
workflows:
- id: release.yaml
ref: '{{.params.branch}}'
input: |
{
"environment": "{{.params.environment}}",
"logLevel": "{{.params.logLevel}}",
"tags": "{{.params.tags}}"
}
FieldDescriptionSchemeRequiredTemplatable
usernameThe account owner of the repository (case insensitive)stringtruetrue
repoThe name of the repository without the .git extensionstringtruetrue
tokenGithub personal access token[]EnvVartrue
workflowsList of workflows to invoke[]Workflow

Github Workflow

FieldDescriptionTypeRequiredTemplatable
idWorkflow id or the workflow file name (eg release.yaml)stringtrue
refBranch name of the tag namestringtrue
inputAzure connectionjsontrue

Templating

Scripts can be templated. The script template receives a environment variable that contain details about the corresponding config, check or component and the parameter(if applicable).

FieldDescriptionSchema
configConfig passed to the playbookConfigItem
componentComponent passed to the playbookComponent
checkCanary Check passed to the playbookCheck
paramsUser provided parameters to the playbookmap[string]string