diff --git a/.github/workflows/precommit.yml b/.github/workflows/precommit.yml index f61745719ae..15db6e62571 100644 --- a/.github/workflows/precommit.yml +++ b/.github/workflows/precommit.yml @@ -48,6 +48,7 @@ jobs: echo "total_additions=$total_additions" >> $GITHUB_ENV - name: Deploy to precommit environment + id: deploy if: ${{ steps.check_additions.outputs.total_additions > 100 && github.actor != 'dependabot[bot]' }} uses: einaregilsson/beanstalk-deploy@v22 with: @@ -62,3 +63,21 @@ jobs: version_label: ${{ github.run_id }} wait_for_deployment: false wait_for_environment_recovery: ${{ env.DEPLOYMENT_RECOVERY_TIMEOUT_SECONDS }} + + - name: Deployment Status + if: ${{ always() }} + run: | + if [[ "${{ steps.deploy.outcome }}" == "success" ]]; then + echo "✅ Deployment completed successfully" + elif [[ "${{ steps.deploy.outcome }}" == "skipped" ]]; then + if [[ "${{ steps.check_additions.outputs.total_additions }}" -le 100 ]]; then + echo "⏭️ Deployment was skipped: PR has ${{ steps.check_additions.outputs.total_additions }} additions (threshold: 100)" + elif [[ "${{ github.actor }}" == "dependabot[bot]" ]]; then + echo "⏭️ Deployment was skipped: PR is from dependabot" + else + echo "⏭️ Deployment was skipped" + fi + else + echo "❌ Deployment failed" + exit 1 + fi