Skip to content

Git Integration

Cloudflare supports connecting Cloudflare Workers to your GitHub and GitLab repositories to look for new changes to your Worker. Workers does not currently support self-hosted instances of GitHub or GitLab, but you can use wrangler deploy with an external CI/CD provider.

Organizational access

You can deploy projects to Cloudflare Workers from your open-source team, company, or side project on both GitHub and GitLab.

GitHub

When authorizing Cloudflare Workers to access a GitHub account, you can specify access to your individual account or an organization that you belong to on GitHub.

To add Cloudflare Workers installation to an organization, your user account must be an owner or have the appropriate role within the organization (i.e. the GitHub Apps Manager role). More information on these roles can be seen on GitHub's documentation.

GitLab

By authorizing Cloudflare Workers to access your GitLab account, you will automatically allow access to organizations, groups, and namespaces your GitLab account can access for use by Cloudflare Workers. Managing access to these organizations and groups is handled by GitLab.

Removing access

GitHub

You can remove Cloudflare Workers' access to your GitHub account by viewing the Applications page on GitHub. The GitHub App is named Cloudflare Workers and Pages, and it is shared between Workers and Pages projects.

Note that removing access to GitHub will disable new builds for Workers and Pages, though the last build of your project will continue to be hosted via Cloudflare Workers.

GitLab

You can remove Cloudflare Workers' access to your GitLab account by navigating to User Settings > Applications > Authorized Applications. Find the applications called Cloudflare Pages and select the Revoke button to revoke access.

Note that the GitLab application Cloudflare Pages is shared between Workers and Pages projects, and removing access to GitLab will disable new builds for Workers and Pages, though the last build of your project will continue to be hosted via Cloudflare Workers.

Reinstall a Git installation

When encountering Git integration related issues, one potential troubleshooting step is attempting to uninstall and reinstall the GitHub or GitLab application associated with the Cloudflare Workers & Pages installation. The process for each Git provider is provided below.

GitHub

  1. Go to the installation settings page on GitHub:
    1. https://github.com/settings/installations for individual accounts.
    2. https://github.com/organizations/<YOUR_ORGANIZATION_NAME>/settings/installations for organizational accounts.
  2. If the Cloudflare Workers and Pages installation is there, click Configure, and click Uninstall "Cloudflare Workers and Pages" (if there is no "Cloudflare Workers and Pages" installation, then no action is needed)
  3. Go back to the Workers & Pages overview page. Select a Worker, then go to Settings > Build.
  4. In the Build settings, either select the GitHub button to establish a GitHub connection, or select Connect then go to the Git Account dropdown and select + New GitHub Connection
  5. Click the + Add account button, click the GitHub account you want to add, and then click Install & Authorize.
  6. You should be redirected to the create project page with your GitHub account or organization in the account list.
  7. Attempt to make a new deployment with your project which was previously broken.

GitLab

  1. Go to your application settings page on GitLab located here: https://gitlab.com/-/profile/applications
  2. Click the "Revoke" button on your Cloudflare Pages installation if it exists.
  3. Go back to the Workers & Pages overview page. Select a Worker, then go to Settings > Build.
  4. In the Build settings, either select the GitLab button to establish a GitLab connection, or select Connect then go to the Git Account dropdown and select + New GitLab Connection
  5. You should be redirected to the create project page with your GitLab account or organization in the account list.
  6. Attempt to make a new deployment with your project which was previously broken.