Skip to main content
Version: v1

GitHub

The GitHub channel reports each deployment through the GitHub Deployments API, so the pull request shows the deployment status and a link to the environment.

This page is for the lead or DevOps engineer who wants deployments to show up on GitHub pull requests. It covers how the channel uses the deployment events, the setup steps and every variable the channel reads.

The channel needs both deployment events:

  • pre_deployment creates a GitHub deployment for the branch.
  • post_deployment marks the newest deployment for that branch as successful, with the environment URL. When the branch has no deployment yet, post_deployment fails.

The Lagoon post-rollout tasks send both events. The Acquia hook sends only post_deployment, so the channel fails on Acquia.

Setup​

To set up GitHub notifications:

  1. Create a classic GitHub personal access token with the repo scope.
  2. Add VORTEX_NOTIFY_GITHUB_TOKEN to your hosting provider's environment variables. When VORTEX_NOTIFY_GITHUB_TOKEN is unset, the channel uses GITHUB_TOKEN.
  3. Add VORTEX_NOTIFY_GITHUB_REPOSITORY to your hosting provider's environment variables, in owner/repo format.
  4. Add github to the comma-separated VORTEX_NOTIFY_CHANNELS list in your .env file, for example VORTEX_NOTIFY_CHANNELS=email,github.

Confirm that the next deployment reached GitHub. The deployment output on your hosting platform shows [ OK ] Finished GitHub notification for post_deployment event. The pull request shows the deployment.

Environment variables​

See the Notifications overview for the router, what a failed channel stops, the shared VORTEX_NOTIFY_* variables and the Location column. The following table lists the variables that the GitHub channel reads:

VariableRequiredDefaultLocationDescription
VORTEX_NOTIFY_GITHUB_TOKENYes, unless GITHUB_TOKEN is setGITHUB_TOKENHostingClassic GitHub personal access token with the repo scope
VORTEX_NOTIFY_GITHUB_REPOSITORYYesNoneHostingRepository in owner/repo format
VORTEX_NOTIFY_GITHUB_ENVIRONMENT_TYPENoVORTEX_NOTIFY_LABEL, then PR.envName of the GitHub environment that each deployment is created in. The label default gives PR-123 for a pull request and the branch name, such as develop, for a branch
VORTEX_NOTIFY_GITHUB_BRANCHESNoNone.envExact branch names to report (comma-separated); empty reports every branch
VORTEX_NOTIFY_GITHUB_BRANCHNoVORTEX_NOTIFY_BRANCHHostingBranch used as the deployment's ref
VORTEX_NOTIFY_GITHUB_ENVIRONMENT_URLNoVORTEX_NOTIFY_ENVIRONMENT_URLHostingEnvironment URL that post_deployment attaches to the deployment
VORTEX_NOTIFY_GITHUB_EVENTNoVORTEX_NOTIFY_EVENTHostingDeployment event: pre_deployment or post_deployment

By default, each pull request and branch gets its own GitHub environment, named after its deployment label, so deploying 1 pull request leaves the deployments of other pull requests active.

Example​

The pull request page shows the deployment status and a View deployment button that opens the deployed environment.

GitHub pull request page showing a successful deployment with a View
deployment button