Skip to content

Adapt bootstrap and autodeploy commands to GitHub Actions#979

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

Adapt bootstrap and autodeploy commands to GitHub Actions#979
Copilot wants to merge 21 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.

Status

image

- 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 <[email protected]>
$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 <[email protected]>
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 <[email protected]>
->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 <[email protected]>
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

@AronNovak
Copy link
Member

This is the first iteration, the config-autodeploy command comes next. Just to not float it in the air for too long.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants