A machine-readable guide to this site for AI agents and language models is available at/llms.txt(https://dev.acquia.com/llms.txt on the production site).
GitHub bidirectional synchronization maintains a continuous connection between your Source CMS site and a GitHub repository. When you publish components in Drupal Canvas, the system automatically commits them to the repository, and synchronizes any changes pushed to the repository back to the Source CMS site. You connect a site to GitHub directly from the Drupal Canvas editor using the GitHub sync extension, which installs the Source CMS App and handles authentication for you. This guide explains how to configure GitHub bidirectional synchronization for a Source CMS site.
To set up GitHub synchronization, you must have the following requirements:
Users can connect a site to GitHub from within the Drupal Canvas editor. The setup wizard installs the Source CMS App, lets users choose where to connect, and pushes the initial site files to the repository.
To connect a site to GitHub:
Click GitHub Sync from the list of extensions.
The Setup GitHub dialog box opens.
After the Installing GitHub App page opens, complete the authorization in the GitHub dialog box.
Source CMS displays Waiting for authorization until the process completes.
On the Pushing to GitHub page, Source CMS creates the branch, prepares the files, and pushes the initial site files to the repository. After each step displays Done, setup is complete.
After setup completes, the extension opens the Recent Activity page. This page confirms the connection and displays the synchronized commit history.
If the Source CMS App is already installed on the organization, Source CMS displays the GitHub is already connected page after you start the connection.
To connect a site to GitHub:
Click GitHub Sync from the list of extensions.
The Setup GitHub dialog box opens.
Use existing organization (recommended): Connect this site through the GitHub organization you previously authorized. Additional setup is not required.
Source CMS continues to the Select Repository & Branch page where you select your Repository and provide a name for your branch.
Connect a different organization: Start a new GitHub authorization to use a different organization or account.
To review or change the repository access of the app on GitHub, select View installation settings.
Sites that were previously connected with a Personal Access Token (PAT) are migrated to the Source CMS App. After you open the GitHub bidirectional sync extension on such a site, Source CMS attempts the migration and keeps the existing repository and branch. Depending on the state of the app, you can refer to one of the following:
Legacy token banner: If the Source CMS App is not yet installed, Source CMS notes that the sync uses a legacy Personal Access Token. Select Install GitHub Sync App and complete the authorization to switch to the app.
Repository access notice: If the app is installed but does not yet have access to the repository, Source CMS prompts you to update repository permissions. Select Update permissions on GitHub, grant the app access to the repository, and select Retry.
After migration, authentication is handled by the GitHub Sync App and you do not manage a token.
If the connection to GitHub is lost, Source CMS displays the Connection error page with the message GitHub connection lost. Common causes include:
The GitHub Sync App was uninstalled.
Repository access was revoked.
Organization permissions changed.
To restore synchronization, select Reconnect GitHub Account. Source CMS disconnects the current setup and returns you to the Connect to GitHub page to connect again.
The Recent Activity page displays the most recent synchronized commits for the connected repository and branch. Each entry lists the author, a relative timestamp, the commit message, and the email address of the author.
To access the Recent Activity page:
The system displays the Recent Activity dialog box.
Select View on GitHub to open the commit history of the repository on GitHub.
The commit history of the repository on GitHub opens in a new browser tab.
To maintain a consistent state between the Source CMS site and the GitHub repository, be aware of the following workflow triggers:
source-to-github workflow pulls all current components and removes the deleted component from the repository.source-to-github workflow and commits the new component to the repository.Users can connect different Source CMS sites to the same GitHub repository through different branches. The system namespaces secrets for each Source CMS site by branch name to avoid conflicts.
For example, the system stores secrets as follows:
MAIN__CANVAS_SITE_URL, MAIN__CANVAS_CLIENT_ID, and MAIN__CANVAS_CLIENT_SECRETSTAGE__CANVAS_SITE_URLThe workflow files dynamically resolve required secrets based on the active branch, which removes the need for manual configuration for each branch.
Disconnect a repository if you migrate to a new GitHub repository, change organization ownership, or stop synchronization for a specific site. With the GitHub Sync App, you disconnect directly from the editor, and you can reconnect afterward.
Click GitHub Sync from the list of extensions.
The system displays the Recent Activity dialog box.
After you disconnect, the extension returns to the Connect to GitHub page. To synchronize the site again, reconnect and select a repository and branch.
On the Select Repository & Branch page, choose a Repository.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
On the Select Repository & Branch page, choose a Repository.
If this content did not answer your questions, try searching or contacting our support team for further assistance.