Skip to content

Adapt bootstrap and autodeploy commands to GitHub Actions#979

Open
Copilot wants to merge 6 commits intomainfrom
copilot/adapt-gh-actions-bootstrap
Open

Adapt bootstrap and autodeploy commands to GitHub Actions#979
Copilot wants to merge 6 commits intomainfrom
copilot/adapt-gh-actions-bootstrap

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

Following the Travis CI → GitHub Actions migration in #952, the bootstrap:project and deploy:config-autodeploy commands still contained Travis CI-specific logic and outdated instructions.

Changes

DeploymentTrait::deployConfigAutodeploy()

  • Removed Travis CI encryption logic (ENCRYPTED_KEY, ENCRYPTED_IV, openssl aes-256-cbc)
  • Removed git add pantheon-key.enc (no longer needed with GitHub Secrets)
  • Removed non-existent template file handling
  • Removed unused $github_deploy_branch and $pantheon_deploy_branch parameters
  • Updated instructions to reference GitHub Secrets (TERMINUS_TOKEN, PANTHEON_DEPLOY_KEY, GH_TOKEN) and Variables (PANTHEON_GIT_URL, ROLLBAR_SERVER_TOKEN)
  • Added automated setup using gh CLI: Automatically installs gh CLI in DDEV if not available, then offers to automatically configure GitHub Secrets and Variables
  • Automatic installation uses sudo and apt-get with quiet flags to minimize output noise
  • Falls back to manual instructions if gh CLI installation fails or user declines automation
  • Added printManualInstructions() helper method for fallback scenarios

BootstrapTrait::bootstrapProject()

  • Enhanced completion message with structured GitHub Actions setup instructions
  • Fixed undefined variable reference ($organization → $github_organization)

README.md

  • Clarified that GitHub Actions workflows are pre-configured
  • Noted that bootstrap auto-updates $githubProject variable in DeploymentTrait
  • Removed outdated branch parameter documentation
  • Documented the automatic gh CLI installation in DDEV

Context

The bootstrap process already correctly updates DeploymentTrait.php line 107-110 with the new project's GitHub org/name. GitHub Actions workflows in .github/workflows/ are already functional and use GitHub's native Secrets/Variables instead of encrypted files.

Users now have a completely automated setup experience in DDEV - gh CLI is automatically installed if missing, and GitHub Secrets/Variables can be configured with a single confirmation prompt. Manual instructions are still provided as a fallback if needed.

Original prompt

This section details on the original issue you should resolve

<issue_title>Adapt new project boostrapping to GH Actions</issue_title>
<issue_description>#952

See above.

We have https://github.com/Gizra/drupal-starter/blob/main/robo-components/BootstrapTrait.php

Make sure we can create new projects based on Drupal Starter, with GH Actions easily. Look around what needs to be adapted / streamlined.
Check README.md on how it's supposed to work, adapt, if needed.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Update BootstrapTrait to provide clearer instructions for GitHub Actions setup
- Update DeploymentTrait::deployConfigAutodeploy to work with GitHub Actions secrets
  - Remove outdated Travis CI encryption logic
  - Remove template file handling that no longer exists
  - Update instructions to match current GH Actions workflow requirements
- Update README.md to clarify automatic deployment setup
  - Note that bootstrap automatically updates githubProject variable
  - Clarify that GitHub Actions workflows are pre-configured
  - Streamline instructions to match new autodeploy output

Co-authored-by: AronNovak <114076+AronNovak@users.noreply.github.com>
$this->say("");
$this->say("3. Review and commit the encrypted key file (pantheon-key.enc)");
$this->say("2. Set up the following GitHub Secrets:");
$this->say(" - Go to: Settings → Secrets and variables → Actions → Secrets → New repository secret");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Can we automate it with gh CLI? If yes, we can install it on-demand inside DDEV and help the user to accomplish this!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Added gh CLI automation in commit 82479da.

The command now:

  • Detects if gh CLI is available
  • Offers to automatically set up GitHub Secrets (TERMINUS_TOKEN, PANTHEON_DEPLOY_KEY, GH_TOKEN) and Variables (PANTHEON_GIT_URL)
  • Falls back to manual instructions if gh CLI is not available or user declines

The gh CLI can be installed on-demand in DDEV, and users will be prompted to confirm before any secrets are set.

- Fix undefined $organization variable in BootstrapTrait (should be $github_organization)
- Remove unused parameters from deployConfigAutodeploy function
- Update docblock to reflect actual function behavior
- Remove misleading documentation about branch parameters in README

Co-authored-by: AronNovak <114076+AronNovak@users.noreply.github.com>
Copilot AI changed the title [WIP] Adapt new project bootstrapping to GH Actions Adapt bootstrap and autodeploy commands to GitHub Actions Jan 29, 2026
Copilot AI requested a review from AronNovak January 29, 2026 13:44
- Detect if gh CLI is available and offer to automate setup
- Automatically set TERMINUS_TOKEN, PANTHEON_DEPLOY_KEY, GH_TOKEN secrets
- Automatically set PANTHEON_GIT_URL variable
- Fall back to manual instructions if gh CLI not available or user declines
- Add printManualInstructions() helper method
- Update README to mention automated setup option

Co-authored-by: AronNovak <114076+AronNovak@users.noreply.github.com>
->run()
->wasSuccessful();

if ($gh_available) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot This is not enough. We are inside DDEV, we can sudo and install gh if it's missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit 9dca072. The command now automatically installs gh CLI using sudo if it's not found in the DDEV environment. Installation uses apt with quiet flags to minimize output noise. If installation fails, it falls back to manual instructions.

- Automatically install gh CLI using apt if not found
- Use sudo to install packages in DDEV environment
- Add quiet flags to apt commands to reduce output noise
- Fall back to manual instructions if installation fails
- Ensure remaining steps (SSH key setup) always show
- Update README to reflect automatic installation

Co-authored-by: AronNovak <114076+AronNovak@users.noreply.github.com>
Copilot AI requested a review from AronNovak January 29, 2026 13:52
@AronNovak AronNovak marked this pull request as ready for review January 31, 2026 04:30
$this->say("GitHub CLI (gh) is not installed. Installing it now...");

// Install gh CLI on Ubuntu/Debian.
$install_commands = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (gh check and init) should be in a helper function, to keep deployConfigAutodeploy more readable. refactor accordingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adapt new project boostrapping to GH Actions

2 participants