From a5603bcee28741501d30a595f561ed9b592e4002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Vieira?= Date: Mon, 14 Jul 2025 14:49:12 +0100 Subject: [PATCH] Refine manual deployment checks to restrict approvals only for production environment (#127) --- .github/workflows/shared-build-deploy-container.yml | 6 +++--- .github/workflows/shared-deploy-container-kubernetes.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/shared-build-deploy-container.yml b/.github/workflows/shared-build-deploy-container.yml index 6518547c..74fd26c8 100644 --- a/.github/workflows/shared-build-deploy-container.yml +++ b/.github/workflows/shared-build-deploy-container.yml @@ -71,12 +71,12 @@ jobs: id: load-environment uses: ./github-actions-shared-build-deploy-container/load-environment - - name: Outputs if this is a workflow_dispatch for staging and production (manual deploy) + - name: Outputs if this is a workflow_dispatch for production (manual deploy) shell: bash id: check-manual-deploy run: | IS_MANUAL_DEPLOY_RESTRICTED="N" - if [[ "${{ steps.load-environment.outputs.environment }}" == "production" || "${{ steps.load-environment.outputs.environment }}" == "staging" ]]; then + if [[ "${{ steps.load-environment.outputs.environment }}" == "production" ]]; then if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "Event workflow_dispatch detected for environment ${{ steps.load-environment.outputs.environment }}." IS_MANUAL_DEPLOY_RESTRICTED="Y" @@ -84,7 +84,7 @@ jobs: fi echo "isManualDeployRestricted=$IS_MANUAL_DEPLOY_RESTRICTED" >> $GITHUB_OUTPUT - - name: Waiting for Approval when deploying to stage or production + - name: Waiting for Approval when deploying to production uses: ./github-actions-shared-build-deploy-container/manual-approval if: ${{ steps.check-manual-deploy.outputs.isManualDeployRestricted == 'Y' }} with: diff --git a/.github/workflows/shared-deploy-container-kubernetes.yml b/.github/workflows/shared-deploy-container-kubernetes.yml index a8bfc400..e18031be 100644 --- a/.github/workflows/shared-deploy-container-kubernetes.yml +++ b/.github/workflows/shared-deploy-container-kubernetes.yml @@ -73,12 +73,12 @@ jobs: echo "environment=$DETECTED_ENVIRONMENT" >> $GITHUB_OUTPUT echo "runnerName=$RUNNER_NAME" >> $GITHUB_OUTPUT - - name: Outputs if this is a workflow_dispatch for staging and production (manual deploy) + - name: Outputs if this is a workflow_dispatch for production (manual deploy) shell: bash id: check-manual-deploy run: | IS_MANUAL_DEPLOY_RESTRICTED="N" - if [[ "${{ steps.load-environment.outputs.environment }}" == "production" || "${{ steps.load-environment.outputs.environment }}" == "staging" ]]; then + if [[ "${{ steps.load-environment.outputs.environment }}" == "production" ]]; then if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "Event workflow_dispatch detected for environment ${{ steps.load-environment.outputs.environment }}." IS_MANUAL_DEPLOY_RESTRICTED="Y" @@ -86,7 +86,7 @@ jobs: fi echo "isManualDeployRestricted=$IS_MANUAL_DEPLOY_RESTRICTED" >> $GITHUB_OUTPUT - - name: Waiting for Approval when deploying to stage or production + - name: Waiting for Approval when deploying to production uses: ./github-actions-shared-deploy-image/manual-approval if: ${{ steps.check-manual-deploy.outputs.isManualDeployRestricted == 'Y' }} with: