From ee1f0d3361145122a596e9be0c07ed6a86c4b226 Mon Sep 17 00:00:00 2001 From: Leonel Enriquez Date: Wed, 24 Apr 2024 11:22:01 -0500 Subject: [PATCH 01/13] Issue #535: Use workflow_dispatch --- scaffold/github/workflows/PantheonReviewApps.yml | 3 +-- scaffold/github/workflows/PantheonReviewAppsDDEV.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/scaffold/github/workflows/PantheonReviewApps.yml b/scaffold/github/workflows/PantheonReviewApps.yml index 8f8ef0a7..8c7504af 100644 --- a/scaffold/github/workflows/PantheonReviewApps.yml +++ b/scaffold/github/workflows/PantheonReviewApps.yml @@ -1,8 +1,7 @@ name: "Pantheon Review Apps" on: - pull_request: - types: [opened, synchronize, reopened] + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} diff --git a/scaffold/github/workflows/PantheonReviewAppsDDEV.yml b/scaffold/github/workflows/PantheonReviewAppsDDEV.yml index 76136555..d83fa7fa 100644 --- a/scaffold/github/workflows/PantheonReviewAppsDDEV.yml +++ b/scaffold/github/workflows/PantheonReviewAppsDDEV.yml @@ -1,8 +1,7 @@ name: "Pantheon Review Apps" on: - pull_request: - types: [opened, synchronize, reopened] + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} From 8801947afe157c8db1c1a6da0c9944218f547276 Mon Sep 17 00:00:00 2001 From: Leonel Enriquez Date: Mon, 29 Apr 2024 17:47:41 -0500 Subject: [PATCH 02/13] Issue #535: Remove workflow_dispatch --- scaffold/github/workflows/PantheonReviewApps.yml | 3 ++- scaffold/github/workflows/PantheonReviewAppsDDEV.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scaffold/github/workflows/PantheonReviewApps.yml b/scaffold/github/workflows/PantheonReviewApps.yml index 8c7504af..8f8ef0a7 100644 --- a/scaffold/github/workflows/PantheonReviewApps.yml +++ b/scaffold/github/workflows/PantheonReviewApps.yml @@ -1,7 +1,8 @@ name: "Pantheon Review Apps" on: - workflow_dispatch: + pull_request: + types: [opened, synchronize, reopened] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} diff --git a/scaffold/github/workflows/PantheonReviewAppsDDEV.yml b/scaffold/github/workflows/PantheonReviewAppsDDEV.yml index d83fa7fa..76136555 100644 --- a/scaffold/github/workflows/PantheonReviewAppsDDEV.yml +++ b/scaffold/github/workflows/PantheonReviewAppsDDEV.yml @@ -1,7 +1,8 @@ name: "Pantheon Review Apps" on: - workflow_dispatch: + pull_request: + types: [opened, synchronize, reopened] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} From f57c15ee0d89afe872fdbdb8691364a9b6dfe0b7 Mon Sep 17 00:00:00 2001 From: Leonel Enriquez Date: Mon, 29 Apr 2024 18:00:21 -0500 Subject: [PATCH 03/13] Issue #535: Use labels to run the Multidev deploy --- .../PantheonReviewAppsDDEVManual.yml | 52 ++++++++++++++ .../workflows/PantheonReviewAppsManual.yml | 72 +++++++++++++++++++ src/ScaffoldInstallerPlugin.php | 11 +++ 3 files changed, 135 insertions(+) create mode 100644 scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml create mode 100644 scaffold/github/workflows/PantheonReviewAppsManual.yml diff --git a/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml b/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml new file mode 100644 index 00000000..86636e05 --- /dev/null +++ b/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml @@ -0,0 +1,52 @@ +name: "Pantheon Review Apps" + +on: + pull_request_target: + types: [ labeled ] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + Drainpipe-Deploy-Pantheon-Multidev: + runs-on: ubuntu-22.04 + if: github.event.label.name == 'pantheon-multidev' + steps: + - uses: actions/checkout@v4 + + - uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/.ddev/.drainpipe-composer-cache + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + - uses: ./.github/actions/drainpipe/set-env + + - name: Install and Start DDEV + uses: ./.github/actions/drainpipe/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }} + + - name: Build Project + env: + directory: /tmp/release + run: | + ddev composer install + ddev task build + ddev task snapshot:directory directory=/tmp/release + + - name: Deploy Pantheon Review App + uses: ./.github/actions/drainpipe/pantheon/review + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + terminus-token: ${{ secrets.PANTHEON_TERMINUS_TOKEN }} + commit-message: ${{ github.sha }} + site-name: ${{ vars.PANTHEON_SITE_NAME || secrets.PANTHEON_SITE_NAME }} + lock-username: ${{ secrets.PANTHEON_REVIEW_USERNAME }} + lock-password: ${{ secrets.PANTHEON_REVIEW_PASSWORD }} + # set to "true" if you want to run the installer + run-installer: ${{ secrets.PANTHEON_REVIEW_RUN_INSTALLER }} diff --git a/scaffold/github/workflows/PantheonReviewAppsManual.yml b/scaffold/github/workflows/PantheonReviewAppsManual.yml new file mode 100644 index 00000000..b0bfc561 --- /dev/null +++ b/scaffold/github/workflows/PantheonReviewAppsManual.yml @@ -0,0 +1,72 @@ +name: "Pantheon Review Apps" + +on: + pull_request_target: + types: [ labeled ] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +# You will also need to add the secrets used below to Dependabot secrets +# if you want this to successfully run in auto-created PRs. +permissions: + deployments: write + contents: read + pull-requests: read + +jobs: + Drainpipe-Deploy-Pantheon-Multidev: + runs-on: ubuntu-22.04 + if: github.event.label.name == 'pantheon-multidev' + steps: + - uses: actions/checkout@v4 + + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + + - uses: actions/cache@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - uses: ./.github/actions/drainpipe/set-env + + - uses: ./.github/actions/drainpipe/setup-git + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + + - uses: ./.github/actions/drainpipe/setup-ssh + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }} + + - uses: ./.github/actions/drainpipe/pantheon/setup-terminus + with: + pantheon-token: ${{ secrets.PANTHEON_TERMINUS_TOKEN }} + terminus-plugins: ${{ vars.TERMINUS_PLUGINS || secrets.TERMINUS_PLUGINS }} + + - uses: php-actions/composer@v6 + + - name: Build Project + env: + directory: /tmp/release + run: | + composer install + task build + task snapshot:directory directory=/tmp/release + + - name: Deploy Pantheon Review App + uses: ./.github/actions/drainpipe/pantheon/review + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + terminus-token: ${{ secrets.PANTHEON_TERMINUS_TOKEN }} + commit-message: ${{ github.sha }} + site-name: ${{ vars.PANTHEON_SITE_NAME || secrets.PANTHEON_SITE_NAME }} + lock-username: ${{ secrets.PANTHEON_REVIEW_USERNAME }} + lock-password: ${{ secrets.PANTHEON_REVIEW_PASSWORD }} diff --git a/src/ScaffoldInstallerPlugin.php b/src/ScaffoldInstallerPlugin.php index b16bcaf8..02e602a3 100644 --- a/src/ScaffoldInstallerPlugin.php +++ b/src/ScaffoldInstallerPlugin.php @@ -293,6 +293,17 @@ private function installCICommands(): void $fs->copy("$scaffoldPath/github/workflows/PantheonReviewApps.yml", './.github/workflows/PantheonReviewApps.yml'); } } + elseif ($github === 'PantheonReviewAppsManual') { + $fs->ensureDirectoryExists('./.github/actions/drainpipe/pantheon'); + $fs->ensureDirectoryExists('./.github/workflows'); + $fs->copy("$scaffoldPath/github/actions/pantheon", './.github/actions/drainpipe/pantheon'); + if (file_exists('./.ddev/config.yaml')) { + $fs->copy("$scaffoldPath/github/workflows/PantheonReviewAppsDDEVManual.yml", './.github/workflows/PantheonReviewApps.yml'); + } + else { + $fs->copy("$scaffoldPath/github/workflows/PantheonReviewAppsManual.yml", './.github/workflows/PantheonReviewApps.yml'); + } + } else if ($github === 'ComposerLockDiff') { $fs->ensureDirectoryExists('./.github/workflows'); $fs->copy("$scaffoldPath/github/workflows/ComposerLockDiff.yml", './.github/workflows/ComposerLockDiff.yml'); From 6dd5bd5962f5364a014fb4f4c8c79a4e03008247 Mon Sep 17 00:00:00 2001 From: Leonel Enriquez Date: Mon, 29 Apr 2024 18:06:47 -0500 Subject: [PATCH 04/13] Issue #535: Fix elseif --- src/ScaffoldInstallerPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ScaffoldInstallerPlugin.php b/src/ScaffoldInstallerPlugin.php index 02e602a3..6d4136f4 100644 --- a/src/ScaffoldInstallerPlugin.php +++ b/src/ScaffoldInstallerPlugin.php @@ -293,7 +293,7 @@ private function installCICommands(): void $fs->copy("$scaffoldPath/github/workflows/PantheonReviewApps.yml", './.github/workflows/PantheonReviewApps.yml'); } } - elseif ($github === 'PantheonReviewAppsManual') { + else if ($github === 'PantheonReviewAppsManual') { $fs->ensureDirectoryExists('./.github/actions/drainpipe/pantheon'); $fs->ensureDirectoryExists('./.github/workflows'); $fs->copy("$scaffoldPath/github/actions/pantheon", './.github/actions/drainpipe/pantheon'); From 74fe0e36f258986a2cf113f1013664a0fe055ba7 Mon Sep 17 00:00:00 2001 From: Leonel Enriquez Date: Tue, 30 Apr 2024 09:45:14 -0500 Subject: [PATCH 05/13] Issue #535: Code Refactor --- scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml | 2 +- scaffold/github/workflows/PantheonReviewAppsManual.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml b/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml index 86636e05..9eeae6e8 100644 --- a/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml +++ b/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml @@ -10,8 +10,8 @@ concurrency: jobs: Drainpipe-Deploy-Pantheon-Multidev: - runs-on: ubuntu-22.04 if: github.event.label.name == 'pantheon-multidev' + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 diff --git a/scaffold/github/workflows/PantheonReviewAppsManual.yml b/scaffold/github/workflows/PantheonReviewAppsManual.yml index b0bfc561..c0765327 100644 --- a/scaffold/github/workflows/PantheonReviewAppsManual.yml +++ b/scaffold/github/workflows/PantheonReviewAppsManual.yml @@ -17,8 +17,8 @@ permissions: jobs: Drainpipe-Deploy-Pantheon-Multidev: - runs-on: ubuntu-22.04 if: github.event.label.name == 'pantheon-multidev' + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 From 778a0a0e98b1e8bd6fa6618f320d097789bd8601 Mon Sep 17 00:00:00 2001 From: Leonel Enriquez Date: Tue, 30 Apr 2024 10:00:18 -0500 Subject: [PATCH 06/13] Issue #535: Code Refactor --- src/ScaffoldInstallerPlugin.php | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/ScaffoldInstallerPlugin.php b/src/ScaffoldInstallerPlugin.php index 6d4136f4..038bb94d 100644 --- a/src/ScaffoldInstallerPlugin.php +++ b/src/ScaffoldInstallerPlugin.php @@ -282,26 +282,16 @@ private function installCICommands(): void $fs->ensureDirectoryExists('./.github/actions'); $fs->copy("$scaffoldPath/github/actions/common", './.github/actions/drainpipe'); foreach ($this->extra['drainpipe']['github'] as $github) { - if ($github === 'PantheonReviewApps') { + if ($github === 'PantheonReviewApps' || $github === 'PantheonReviewAppsManual') { $fs->ensureDirectoryExists('./.github/actions/drainpipe/pantheon'); $fs->ensureDirectoryExists('./.github/workflows'); $fs->copy("$scaffoldPath/github/actions/pantheon", './.github/actions/drainpipe/pantheon'); + $is_manual = $github === 'PantheonReviewAppsManual' ? 'Manual' : ''; if (file_exists('./.ddev/config.yaml')) { - $fs->copy("$scaffoldPath/github/workflows/PantheonReviewAppsDDEV.yml", './.github/workflows/PantheonReviewApps.yml'); + $fs->copy("$scaffoldPath/github/workflows/PantheonReviewAppsDDEV$is_manual.yml", './.github/workflows/PantheonReviewApps.yml'); } else { - $fs->copy("$scaffoldPath/github/workflows/PantheonReviewApps.yml", './.github/workflows/PantheonReviewApps.yml'); - } - } - else if ($github === 'PantheonReviewAppsManual') { - $fs->ensureDirectoryExists('./.github/actions/drainpipe/pantheon'); - $fs->ensureDirectoryExists('./.github/workflows'); - $fs->copy("$scaffoldPath/github/actions/pantheon", './.github/actions/drainpipe/pantheon'); - if (file_exists('./.ddev/config.yaml')) { - $fs->copy("$scaffoldPath/github/workflows/PantheonReviewAppsDDEVManual.yml", './.github/workflows/PantheonReviewApps.yml'); - } - else { - $fs->copy("$scaffoldPath/github/workflows/PantheonReviewAppsManual.yml", './.github/workflows/PantheonReviewApps.yml'); + $fs->copy("$scaffoldPath/github/workflows/PantheonReviewApps$is_manual.yml", './.github/workflows/PantheonReviewApps.yml'); } } else if ($github === 'ComposerLockDiff') { From c251e46c6d0cbdf96fd0d2597408af8c57c63385 Mon Sep 17 00:00:00 2001 From: Leonel Enriquez Date: Thu, 2 May 2024 15:25:00 -0500 Subject: [PATCH 07/13] Issue #535: Use pull_request --- scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml | 2 +- scaffold/github/workflows/PantheonReviewAppsManual.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml b/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml index 9eeae6e8..8976f015 100644 --- a/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml +++ b/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml @@ -1,7 +1,7 @@ name: "Pantheon Review Apps" on: - pull_request_target: + pull_request: types: [ labeled ] concurrency: diff --git a/scaffold/github/workflows/PantheonReviewAppsManual.yml b/scaffold/github/workflows/PantheonReviewAppsManual.yml index c0765327..acd4502c 100644 --- a/scaffold/github/workflows/PantheonReviewAppsManual.yml +++ b/scaffold/github/workflows/PantheonReviewAppsManual.yml @@ -1,7 +1,7 @@ name: "Pantheon Review Apps" on: - pull_request_target: + pull_request: types: [ labeled ] concurrency: From 944c0d81bb4f705d09e7d231d231e9523740f8a5 Mon Sep 17 00:00:00 2001 From: Leonel Enriquez Date: Mon, 6 May 2024 10:40:36 -0500 Subject: [PATCH 08/13] Issue #535: Remove extra parentheses --- scaffold/github/actions/pantheon/review/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/pantheon/review/action.yml b/scaffold/github/actions/pantheon/review/action.yml index 2e753416..4cf0173b 100644 --- a/scaffold/github/actions/pantheon/review/action.yml +++ b/scaffold/github/actions/pantheon/review/action.yml @@ -112,7 +112,7 @@ runs: drainpipe_exec "terminus aliases --only ${{ inputs.site-name }} --yes" if [ "${{ inputs.run-installer }}" == "true" ]; then drainpipe_exec "./vendor/bin/drush @${{ inputs.site-name }}.pr-$DRAINPIPE_PR_NUMBER --yes site:install --existing-config" - elif drainpipe_exec "./vendor/bin/task -l | grep '* update: ')"; then + elif drainpipe_exec "./vendor/bin/task -l | grep '* update: '"; then drainpipe_exec "./vendor/bin/task update site=@${{ inputs.site-name }}.pr-$DRAINPIPE_PR_NUMBER" else drainpipe_exec "./vendor/bin/task drupal:update site=@${{ inputs.site-name }}.pr-$DRAINPIPE_PR_NUMBER" From 37e5e6ed74f5b44a5ba206f9590747b9fd980b1b Mon Sep 17 00:00:00 2001 From: Leonel Enriquez Date: Thu, 16 May 2024 09:18:09 -0500 Subject: [PATCH 09/13] Issue #535: Add opened, synchronize, and reopened --- scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml | 2 +- scaffold/github/workflows/PantheonReviewAppsManual.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml b/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml index 8976f015..684cad55 100644 --- a/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml +++ b/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml @@ -2,7 +2,7 @@ name: "Pantheon Review Apps" on: pull_request: - types: [ labeled ] + types: [ labeled, opened, synchronize, reopened] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} diff --git a/scaffold/github/workflows/PantheonReviewAppsManual.yml b/scaffold/github/workflows/PantheonReviewAppsManual.yml index acd4502c..9475d67e 100644 --- a/scaffold/github/workflows/PantheonReviewAppsManual.yml +++ b/scaffold/github/workflows/PantheonReviewAppsManual.yml @@ -2,7 +2,7 @@ name: "Pantheon Review Apps" on: pull_request: - types: [ labeled ] + types: [ labeled, opened, synchronize, reopened] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} From 1bc0f5bd3166cb61be193946491b973806e7be73 Mon Sep 17 00:00:00 2001 From: Leonel Enriquez Date: Thu, 16 May 2024 09:52:32 -0500 Subject: [PATCH 10/13] Issue #535: Code Refactor --- scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml | 4 ++-- scaffold/github/workflows/PantheonReviewAppsManual.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml b/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml index 684cad55..142c5aca 100644 --- a/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml +++ b/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml @@ -2,7 +2,7 @@ name: "Pantheon Review Apps" on: pull_request: - types: [ labeled, opened, synchronize, reopened] + types: [ labeled, unlabeled, opened, synchronize, reopened] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -10,7 +10,7 @@ concurrency: jobs: Drainpipe-Deploy-Pantheon-Multidev: - if: github.event.label.name == 'pantheon-multidev' + if: contains(github.event.pull_request.labels.*.name, 'pantheon-multidev') runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 diff --git a/scaffold/github/workflows/PantheonReviewAppsManual.yml b/scaffold/github/workflows/PantheonReviewAppsManual.yml index 9475d67e..941aaa6f 100644 --- a/scaffold/github/workflows/PantheonReviewAppsManual.yml +++ b/scaffold/github/workflows/PantheonReviewAppsManual.yml @@ -2,7 +2,7 @@ name: "Pantheon Review Apps" on: pull_request: - types: [ labeled, opened, synchronize, reopened] + types: [ labeled, unlabeled, opened, synchronize, reopened] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -17,7 +17,7 @@ permissions: jobs: Drainpipe-Deploy-Pantheon-Multidev: - if: github.event.label.name == 'pantheon-multidev' + if: contains(github.event.pull_request.labels.*.name, 'pantheon-multidev') runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 From 2ff10619cd3d730df83003bd43da6ac8d3f36779 Mon Sep 17 00:00:00 2001 From: Leonel Enriquez Date: Thu, 16 May 2024 10:19:26 -0500 Subject: [PATCH 11/13] Issue #535: Code Refactor --- ...AppsDDEVManual.yml => PantheonReviewAppsManualDDEV.yml} | 0 src/ScaffoldInstallerPlugin.php | 7 ++++--- 2 files changed, 4 insertions(+), 3 deletions(-) rename scaffold/github/workflows/{PantheonReviewAppsDDEVManual.yml => PantheonReviewAppsManualDDEV.yml} (100%) diff --git a/scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml b/scaffold/github/workflows/PantheonReviewAppsManualDDEV.yml similarity index 100% rename from scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml rename to scaffold/github/workflows/PantheonReviewAppsManualDDEV.yml diff --git a/src/ScaffoldInstallerPlugin.php b/src/ScaffoldInstallerPlugin.php index 35ab0f82..68e3e76a 100644 --- a/src/ScaffoldInstallerPlugin.php +++ b/src/ScaffoldInstallerPlugin.php @@ -298,12 +298,13 @@ private function installCICommands(): void $fs->ensureDirectoryExists('./.github/actions/drainpipe/pantheon'); $fs->ensureDirectoryExists('./.github/workflows'); $fs->copy("$scaffoldPath/github/actions/pantheon", './.github/actions/drainpipe/pantheon'); - $is_manual = $github === 'PantheonReviewAppsManual' ? 'Manual' : ''; + $pantheon_review_apps = $github === 'PantheonReviewAppsManual' ?: 'PantheonReviewApps'; if (file_exists('./.ddev/config.yaml')) { - $fs->copy("$scaffoldPath/github/workflows/PantheonReviewAppsDDEV$is_manual.yml", './.github/workflows/PantheonReviewApps.yml'); + $pantheon_review_apps_ddev = $pantheon_review_apps . 'DDEV'; + $fs->copy("$scaffoldPath/github/workflows/$pantheon_review_apps_ddev.yml", './.github/workflows/PantheonReviewApps.yml'); } else { - $fs->copy("$scaffoldPath/github/workflows/PantheonReviewApps$is_manual.yml", './.github/workflows/PantheonReviewApps.yml'); + $fs->copy("$scaffoldPath/github/workflows/$pantheon_review_apps.yml", './.github/workflows/PantheonReviewApps.yml'); } } else if ($github === 'ComposerLockDiff') { From 468b177cecc450f42f9928852e4896225810f83a Mon Sep 17 00:00:00 2001 From: Leonel Enriquez Date: Thu, 16 May 2024 10:29:19 -0500 Subject: [PATCH 12/13] Issue #535: Code Refactor --- src/ScaffoldInstallerPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ScaffoldInstallerPlugin.php b/src/ScaffoldInstallerPlugin.php index 68e3e76a..4fc98112 100644 --- a/src/ScaffoldInstallerPlugin.php +++ b/src/ScaffoldInstallerPlugin.php @@ -298,7 +298,7 @@ private function installCICommands(): void $fs->ensureDirectoryExists('./.github/actions/drainpipe/pantheon'); $fs->ensureDirectoryExists('./.github/workflows'); $fs->copy("$scaffoldPath/github/actions/pantheon", './.github/actions/drainpipe/pantheon'); - $pantheon_review_apps = $github === 'PantheonReviewAppsManual' ?: 'PantheonReviewApps'; + $pantheon_review_apps = ($github === 'PantheonReviewApps') ? 'PantheonReviewApps' : 'PantheonReviewAppsManual'; if (file_exists('./.ddev/config.yaml')) { $pantheon_review_apps_ddev = $pantheon_review_apps . 'DDEV'; $fs->copy("$scaffoldPath/github/workflows/$pantheon_review_apps_ddev.yml", './.github/workflows/PantheonReviewApps.yml'); From ab80299864a0713b181a1e19a3a0b9e7d35b018f Mon Sep 17 00:00:00 2001 From: Cathy Theys Date: Wed, 28 Aug 2024 09:44:48 -0400 Subject: [PATCH 13/13] remove unlabeled. seems like a copy and paste, since this PR is about only working on labeled PRs. --- scaffold/github/workflows/PantheonReviewAppsManual.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/workflows/PantheonReviewAppsManual.yml b/scaffold/github/workflows/PantheonReviewAppsManual.yml index 941aaa6f..8d4f2746 100644 --- a/scaffold/github/workflows/PantheonReviewAppsManual.yml +++ b/scaffold/github/workflows/PantheonReviewAppsManual.yml @@ -2,7 +2,7 @@ name: "Pantheon Review Apps" on: pull_request: - types: [ labeled, unlabeled, opened, synchronize, reopened] + types: [ labeled, opened, synchronize, reopened] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}