diff --git a/.github/workflows/dispatch-webhook-lagoon.yml b/.github/workflows/close-pull-request.yml similarity index 57% rename from .github/workflows/dispatch-webhook-lagoon.yml rename to .github/workflows/close-pull-request.yml index 5d16cb4df..e283e0815 100644 --- a/.github/workflows/dispatch-webhook-lagoon.yml +++ b/.github/workflows/close-pull-request.yml @@ -1,19 +1,16 @@ ## -# GitHub Actions workflow to dispatch a PR webhook for a Pull Request. +# GitHub Actions workflow to action on Pull Request closure. # -# This is used to allow more granular control over the operations that trigger -# webhooks. -# -# Note that Lagoon's webhook should be disabled in GitHub. -name: Dispatch a webhook to Lagoon when Pull Request is closed +name: Close Pull Request on: pull_request: - types: [closed] + types: + - closed jobs: - dispatch_webhook_lagoon_remove_environment_pr_closed: + remove_lagoon_environment: runs-on: ubuntu-latest steps: - name: Remove environment after a PR is closed diff --git a/.scaffold/tests/bats/_helper.bash b/.scaffold/tests/bats/_helper.bash index b41577efb..84b1445dd 100644 --- a/.scaffold/tests/bats/_helper.bash +++ b/.scaffold/tests/bats/_helper.bash @@ -772,7 +772,7 @@ assert_files_present_integration_lagoon() { assert_file_exists ".lagoon.yml" assert_file_exists "drush/sites/lagoon.site.yml" - assert_file_exists ".github/workflows/dispatch-webhook-lagoon.yml" + assert_file_exists ".github/workflows/close-pull-request.yml" assert_file_contains "docker-compose.yml" "labels" assert_file_contains "docker-compose.yml" "lagoon.type: cli-persistent" assert_file_contains "docker-compose.yml" "lagoon.persistent.name: &lagoon-nginx-name nginx-php" @@ -795,7 +795,7 @@ assert_files_present_no_integration_lagoon() { assert_file_not_exists ".lagoon.yml" assert_file_not_exists "drush/sites/lagoon.site.yml" - assert_file_not_exists ".github/workflows/dispatch-webhook-lagoon.yml" + assert_file_not_exists ".github/workflows/close-pull-request.yml" assert_file_not_contains "docker-compose.yml" "labels" assert_file_not_contains "docker-compose.yml" "lagoon.type: cli-persistent" assert_file_not_contains "docker-compose.yml" "lagoon.persistent.name: &lagoon-nginx-name nginx-php"