GitHub Actions Trigger

GitHub Actions Trigger

Certified

Trigger a flow when GitHub Actions runs complete

Polls a repository at the configured interval and starts one execution when at least one workflow run has completed since the previous evaluation. The state is kept in the namespace KV Store: a watermark (the previous evaluation time on the first poll) and the runs already delivered. Each poll looks back 5 minutes before the watermark, so a run that GitHub lists late or a clock drift cannot make it skip a run, and a run is never delivered twice. On the first poll the watermark is the trigger creation time, so runs that completed up to 5 minutes before the trigger was created are reported as well. A run still in progress at one poll is reported once it completes. Only the latest limit completed runs are scanned. The token needs the actions: read permission.

yaml
type: io.kestra.plugin.github.actions.Trigger

Run a flow whenever a workflow fails on the main branch.

yaml
id: github_actions_failed_run
namespace: company.team

tasks:
  - id: log_failures
    type: io.kestra.plugin.core.log.Log
    message: "{{ trigger.size }} failed run(s): {{ trigger.runs }}"

triggers:
  - id: watch_runs
    type: io.kestra.plugin.github.actions.Trigger
    oauthToken: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
    repository: my-org/my-repo
    workflowId: ci.yml
    branch: main
    conclusion: FAILURE
    interval: PT1M
Properties

Target repository

Repository in owner/repo format to watch.

Defaultfalse

Specifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.

GitHub App installation token

Installation access token generated by a GitHub App.

Branch

Only report runs for this branch.

Possible Values
SUCCESSFAILURECANCELLEDSKIPPEDNEUTRALTIMED_OUTACTION_REQUIREDSTALESTARTUP_FAILURE

Conclusion

Only report runs with this conclusion, for example SUCCESS or FAILURE. All completed runs are reported when unset.

GitHub API endpoint

GitHub or GitHub Enterprise API base URL such as https://api.github.com. Set this when targeting GitHub Enterprise or a non-default API endpoint.

Possible Values
PUSHPULL_REQUESTPULL_REQUEST_TARGETWORKFLOW_DISPATCHWORKFLOW_RUNSCHEDULERELEASEREPOSITORY_DISPATCHISSUESISSUE_COMMENTMERGE_GROUPCREATEDELETEFORK

Event

Only report runs triggered by this event, for example PUSH or WORKFLOW_DISPATCH.

DefaultPT1M
Formatduration

Interval between polls

ISO 8601 duration between two evaluations.

GitHub JWT token

GitHub App JWT used for app-level authentication.

Default50

Limit

Number of latest completed runs scanned at each poll, between 1 and 100 (default 50).

GitHub login

GitHub login used with oauthToken for authenticated requests.

GitHub OAuth token

GitHub personal access token used for authenticated requests.

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

List of execution states after which a trigger should be stopped (a.k.a. disabled).

Defaulttrue

A condition that determines whether the trigger should run.

A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.

Workflow

Only report runs of this workflow, given as its numeric id or its file name such as ci.yml. The filter is applied after fetching, so at most the 500 most recent runs of the repository are examined.

Runs

Completed runs found since the previous evaluation, with id, number, status, conclusion, event, branch, sha, URL and timestamps.

Definitions
conclusionstring

Conclusion

Run conclusion such as success or failure. Only set when the run is completed.

createdAtstring
Formatdate-time

Created at

When the run was created.

eventstring

Event

Event that triggered the run, for example push or workflow_dispatch.

headBranchstring

Head branch

Branch the run was executed on.

headShastring

Head SHA

Commit SHA the run was executed on.

htmlUrlstring

Run URL

URL of the run on GitHub.

runIdinteger

Run ID

Id of the workflow run.

runNumberinteger

Run number

Sequential number of the run within the workflow.

statusstring

Status

Run status such as queued, in_progress or completed.

updatedAtstring
Formatdate-time

Updated at

When the run was last updated.

Size

Number of runs found.