From 505409fb3191f822d16c5ccb50317923054de635 Mon Sep 17 00:00:00 2001 From: sandhya1874 Date: Wed, 4 Dec 2024 14:34:06 +0000 Subject: [PATCH 1/2] Updated to correct the condition --- .github/workflows/pipeline.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index dff03fa..3a1d752 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -5,6 +5,10 @@ on: branches: - main + pull_request: + types: + - closed + workflow_dispatch: inputs: environment: @@ -51,7 +55,7 @@ jobs: deploy_to_dev_on_push_to_main: name: Deploy to dev on push to main - if: github.event.pull_request.merged == true && github.base_ref == 'refs/heads/main' + if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true uses: ./.github/workflows/deploy.yml needs: - build @@ -62,7 +66,7 @@ jobs: deploy_to_prod_on_push_to_main: name: Deploy to prod on push to main - if: github.event.pull_request.merged == true && github.base_ref == 'refs/heads/main' + if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true uses: ./.github/workflows/deploy.yml needs: - build From 2115d78d8d32e0c49829196dafb1f4d678227a75 Mon Sep 17 00:00:00 2001 From: Sandhya1874 <39799075+Sandhya1874@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:52:32 +0000 Subject: [PATCH 2/2] Update pipeline.yml --- .github/workflows/pipeline.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 3a1d752..695fbd8 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -1,10 +1,6 @@ name: Pipeline on: - push: - branches: - - main - pull_request: types: - closed