Eventline is now open source and available on GitHub !

If you are still using the old Eventline platform, contact us to migrate to the new service, and head to the new documentation website for more information.

github

Description

The github connector provides identities and events for the GitHub platform.

Identities

oauth2

The oauth2 identity contains a username and an OAuth2 access token.

During the creation of an oauth2 identity, you will be redirected to the GitHub website to authorize the creation of a new access token.

Note that due to a limitation of the ghcr.io Docker registry, this identity cannot be use as registry identity.

Data fields

username (string)
The name of the GitHub account.
scopes (string array)
The list of OAuth2 scopes.
access_token (string)
The OAuth2 access token (optional). Automatically handled by Eventline.
refresh_token (string)
The OAuth2 refresh token (optional). Automatically handled by Eventline.
expiration_time (string)
The expiration date for the access token (optional). Automatically handled by Eventline.

Environment variables

GITHUB_USER
The name of the GitHub account.
GITHUB_TOKEN
The GitHub access token.

These environment variables are used by the official GitHub command line tool among others.

token

The token identity is used to store GitHub personal access tokens.

token identities used for triggers require the following scopes:

  • admin:repo_hook
  • admin:org_hook
  • read:packages

If you intend to use a token identity in a task, for example to interact with the GitHub API, you may need to add additional permissions.

This identity can be used as registry identity.

Data fields

username (string)
The name of the GitHub account.
token (string)
The GitHub private access token.

Environment variables

GITHUB_USER
The name of the GitHub account.
GITHUB_TOKEN
The GitHub private access token.

These environment variables are used by the official GitHub command line tool among others.

Events

push

The push event is emitted when one or more commits are pushed to a repository.

Data fields

organization (string)
The name of the GitHub organization.
repository (string)
The name of the GitHub repository.
branch (string)
The name of the Git branch.
old_revision (string)
The hash of the most recent commit on the branch before the push (optional).
new_revision (string)
The hash of the most recent commit on the branch after the push.

The old_revision field will not be present for the first push event on a new repository or on a new branch.

repository_creation

The repository_creation event is emitted when a new repository is created in the organization.

Data fields

organization (string)
The name of the GitHub organization.
repository (string)
The name of the GitHub repository.

repository_deletion

The repository_deletion event is emitted when a repository is deleted from the organization.

Data fields

organization (string)
The name of the GitHub organization.
repository (string)
The name of the GitHub repository.

tag_creation

The tag_creation event is emitted when a tag is created in a repository.

Warning
Due to GitHub limitations, no event will be emitted when more than three commits are created or deleted in the same push. See the GitHub documentation for more information.

Data fields

organization (string)
The name of the GitHub organization.
repository (string)
The name of the GitHub repository.
tag (string)
The name of the tag.
revision (string)
The hash associated with the tag.

tag_deletion

The tag_deletion event is emitted when a Git tag is deleted from a repository.

Warning
Due to GitHub limitations, no event will be emitted when more than three commits are created or deleted in the same push. See the GitHub documentation for more information.

Data fields

organization (string)
The name of the GitHub organization.
repository (string)
The name of the GitHub repository.
tag (string)
The name of the tag.
revision (string)
The hash associated with the tag.

branch_creation

The branch_creation event is emitted when a branch is created in a repository.

Info
Eventline will always emit two events when a branch is created: first a github.branch_creation event, then a github.push event associated with the new branch. This makes it easier to create triggers which are activated on any new commits, and not just on commits pushed on existing branches.

Data fields

organization (string)
The name of the GitHub organization.
repository (string)
The name of the GitHub repository.
branch (string)
The name of the branch.
revision (string)
The hash of the last commit on the branch at its creation.

branch_deletion

The branch_deletion event is emitted when a Git branch is deleted from a repository.

Data fields

organization (string)
The name of the GitHub organization.
repository (string)
The name of the GitHub repository.
branch (string)
The name of the branch.
revision (string)
The hash of the last commit on the branch before its deletion.

Examples

Trigger

Push

---
type: "trigger"
version: 1
name: "new-tag"
data:
  connector: "github"
  event: "push"
  identity: "exobot-account"
  parameters:
    organization: "exograd"
    repository: "evcli"
  filters:
    - path: "/branch"
      is_equal_to: "master"
  pipelines:
    - "release-evcli"