Skip to content

Commit

Permalink
chore: add deployment status
Browse files Browse the repository at this point in the history
  • Loading branch information
tlebon committed Nov 19, 2024
1 parent f42a479 commit f79e50b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ jobs:
# Parse the JSON response directly without storing in file
total_additions=$(echo '${{ fromJSON(steps.pr_details.outputs.data).additions }}')
echo "Total additions: $total_additions"
echo "total_additions=$total_additions" >> $GITHUB_ENV
echo "::set-output name=total_additions::$total_additions"
- 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:
Expand All @@ -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

0 comments on commit f79e50b

Please sign in to comment.