From 4b7f92e81d85ad0685c91e438021f48b4252edcd Mon Sep 17 00:00:00 2001 From: Miriam Goldman Date: Tue, 30 Jul 2024 11:28:01 -0400 Subject: [PATCH 1/3] try new action --- .github/workflows/multidev-removal.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/multidev-removal.yml b/.github/workflows/multidev-removal.yml index 363b70c3..d7fe5e7b 100644 --- a/.github/workflows/multidev-removal.yml +++ b/.github/workflows/multidev-removal.yml @@ -29,11 +29,13 @@ jobs: pantheon-machine-token: ${{ secrets.TERMINUS_TOKEN }} - name: Determine target environment and maybe delete it + uses: 8BitJonny/gh-get-current-pr@3.0.0 + id: PR run: | # Use the PR number as the environment name env=$(echo ${{ github.ref_name }} | sed 's|^\([0-9]*\)/.*|pr-\1|') - source=$(echo ${{ github.head_ref }} | sed 's|^\([0-9]*\)/.*|pr-\1|') - echo "Source is $source" + prnum=$(echo ${{ steps.PR.outputs.number }} + echo "Source is $prnum" # Ensure environment name is 11 characters or less and has no special characters env="${env:0:11}" From 0b07e400568ee78ba4788157a5e7093ecb416e29 Mon Sep 17 00:00:00 2001 From: Miriam Goldman Date: Tue, 30 Jul 2024 11:37:08 -0400 Subject: [PATCH 2/3] fix uses and run --- .github/workflows/multidev-removal.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/multidev-removal.yml b/.github/workflows/multidev-removal.yml index d7fe5e7b..ca5a3a5c 100644 --- a/.github/workflows/multidev-removal.yml +++ b/.github/workflows/multidev-removal.yml @@ -23,14 +23,15 @@ jobs: needs: [ configure_env ] if: github.event_name == 'pull_request' steps: + - uses: 8BitJonny/gh-get-current-pr@3.0.0 + id: PR + - name: Install Terminus uses: pantheon-systems/terminus-github-actions@v1 with: pantheon-machine-token: ${{ secrets.TERMINUS_TOKEN }} - name: Determine target environment and maybe delete it - uses: 8BitJonny/gh-get-current-pr@3.0.0 - id: PR run: | # Use the PR number as the environment name env=$(echo ${{ github.ref_name }} | sed 's|^\([0-9]*\)/.*|pr-\1|') From 0d3e3fd29cdb89e107c4578153c6d134868ae319 Mon Sep 17 00:00:00 2001 From: Miriam Goldman Date: Tue, 30 Jul 2024 12:44:40 -0400 Subject: [PATCH 3/3] remove external action and add number thing --- .github/workflows/multidev-removal.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/multidev-removal.yml b/.github/workflows/multidev-removal.yml index ca5a3a5c..dd08bddf 100644 --- a/.github/workflows/multidev-removal.yml +++ b/.github/workflows/multidev-removal.yml @@ -23,9 +23,6 @@ jobs: needs: [ configure_env ] if: github.event_name == 'pull_request' steps: - - uses: 8BitJonny/gh-get-current-pr@3.0.0 - id: PR - - name: Install Terminus uses: pantheon-systems/terminus-github-actions@v1 with: @@ -35,8 +32,9 @@ jobs: run: | # Use the PR number as the environment name env=$(echo ${{ github.ref_name }} | sed 's|^\([0-9]*\)/.*|pr-\1|') - prnum=$(echo ${{ steps.PR.outputs.number }} - echo "Source is $prnum" + prnum="${{ github.event.pull_request.number }}" + + echo "The PR num is $prnum" # Ensure environment name is 11 characters or less and has no special characters env="${env:0:11}"