From cf7dfcac31d9dbb72250321e8fd7fd0861313eac Mon Sep 17 00:00:00 2001 From: Bill Randall Date: Fri, 26 Apr 2024 16:23:19 -0400 Subject: [PATCH 1/2] Remove extra step (this was done before but got lost in the rebase) --- .github/workflows/preview-close.yml | 5 ----- .github/workflows/preview.yml | 5 ----- 2 files changed, 10 deletions(-) diff --git a/.github/workflows/preview-close.yml b/.github/workflows/preview-close.yml index effaa25ab..4b84d51a7 100644 --- a/.github/workflows/preview-close.yml +++ b/.github/workflows/preview-close.yml @@ -18,11 +18,6 @@ jobs: aws-region: us-east-1 role-to-assume: ${{ secrets.AWS_GITHUB_ACTIONS_ROLE }} output-credentials: true - - name: set branchname env - id: setbranchname - run: | - # use GITHUB_HEAD_REF that is set to PR source branch - echo "branch=$GITHUB_HEAD_REF" >> "$GITHUB_OUTPUT" - name: cleanup PR preview branch uses: yinlinchen/amplify-preview-actions@v1.2 with: diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index e4a8e06d2..d99b93793 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -21,11 +21,6 @@ jobs: aws-region: us-east-1 role-to-assume: ${{ secrets.AWS_GITHUB_ACTIONS_ROLE }} output-credentials: true - - name: set branch name env - id: setbranchname - run: | - # use GITHUB_HEAD_REF that is set to PR source branch - echo "branch=$GITHUB_HEAD_REF" >> "$GITHUB_OUTPUT" - name: deploy PR preview uses: CruGlobal/amplify-preview-actions@handle-existing-branches with: From ce583dcd2244e03bdcf57b5f76c434e64c6068e0 Mon Sep 17 00:00:00 2001 From: Bill Randall Date: Mon, 29 Apr 2024 14:38:41 -0400 Subject: [PATCH 2/2] Try only running this job when the actual label added is the preview environment label (not if any label includes this text). This should ensure we do not run it more than we need --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index d99b93793..a54901235 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -6,7 +6,7 @@ on: jobs: deploy: - if: contains(github.event.pull_request.labels.*.name, 'Preview Environment') + if: contains(github.event.label.name, 'Preview Environment') runs-on: ubuntu-latest continue-on-error: true permissions: