From 8e2ade1cc5f37a23725ff4badd2c536f4ce31a91 Mon Sep 17 00:00:00 2001 From: Jorge Vallecillo Date: Mon, 3 Apr 2023 12:06:35 -0600 Subject: [PATCH] Run tf apply step only on merge to main. Closes #6 --- .github/workflows/build-and-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index faeec74..364ef5e 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -85,7 +85,7 @@ jobs: - name: Terraform apply id: apply - if: github.ref == 'refs/heads/"main"' && github.event_name == 'push' + if: github.ref == 'refs/heads/main' && github.event.pull_request.merged == true run: | terraform apply --auto-approve -no-color \ -var "civo_api_token=${{ secrets.CIVO_API_TOKEN }}"