From 1ea3d2e220a1c2e73a4a6bed19a8908415b220b1 Mon Sep 17 00:00:00 2001 From: Miriam Goldman Date: Tue, 30 Jul 2024 10:58:18 -0400 Subject: [PATCH 1/2] continue to try and get source head pr name --- .github/workflows/multidev-removal.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/multidev-removal.yml b/.github/workflows/multidev-removal.yml index bda3546b..1c6e547c 100644 --- a/.github/workflows/multidev-removal.yml +++ b/.github/workflows/multidev-removal.yml @@ -33,12 +33,10 @@ jobs: # Use the PR number as the environment name env=$(echo ${{ github.ref_name }} | sed 's|^\([0-9]*\)/.*|pr-\1|') - echo "Source is ${{ github.head_ref }}" + echo "Source is ${{ github.head_ref }} | sed 's|^\([0-9]*\)/.*|pr-\1|')" # Ensure environment name is 11 characters or less and has no special characters env="${env:0:11}" env=$(echo "$env" | sed 's/[^a-zA-Z0-9]/-/g') - - echo "Deleting environment $env" - + terminus env:delete ${{ vars.SITE_NAME }}.$env --delete-branch --yes \ No newline at end of file From 5f8298e843669d23bab098b5c669af3e21b2401e Mon Sep 17 00:00:00 2001 From: Miriam Goldman Date: Tue, 30 Jul 2024 11:10:02 -0400 Subject: [PATCH 2/2] get source into a var --- .github/workflows/multidev-removal.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/multidev-removal.yml b/.github/workflows/multidev-removal.yml index 1c6e547c..363b70c3 100644 --- a/.github/workflows/multidev-removal.yml +++ b/.github/workflows/multidev-removal.yml @@ -32,8 +32,8 @@ jobs: run: | # Use the PR number as the environment name env=$(echo ${{ github.ref_name }} | sed 's|^\([0-9]*\)/.*|pr-\1|') - - echo "Source is ${{ github.head_ref }} | sed 's|^\([0-9]*\)/.*|pr-\1|')" + source=$(echo ${{ github.head_ref }} | sed 's|^\([0-9]*\)/.*|pr-\1|') + echo "Source is $source" # Ensure environment name is 11 characters or less and has no special characters env="${env:0:11}"