diff --git a/.github/workflows/precommit.yml b/.github/workflows/precommit.yml index 0a1752cf36e..f978e097013 100644 --- a/.github/workflows/precommit.yml +++ b/.github/workflows/precommit.yml @@ -16,6 +16,7 @@ jobs: outputs: unit_tests_report: ${{ env.UNIT_TEST_REPORT_FILE }} build_artifact: ${{ env.BUILD_ARTIFACT }} + total_additions: ${{ steps.check_additions.outputs.total_additions }} env: BUILD_DIR: server/dist/s3/ @@ -72,10 +73,13 @@ jobs: - name: Check total PR additions id: check_additions run: | - # 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 + # Store response data in variable + response='${{ steps.pr_details.outputs.data }}' + # Parse additions from response + total_additions=$(echo "$response" | jq -r '.additions') + echo "Found total additions: $total_additions" + # Output for subsequent steps + echo "total_additions=$total_additions" >> $GITHUB_OUTPUT deploy_to_aws: name: 'Deploy to live environments' @@ -110,8 +114,8 @@ jobs: if [[ "${{ steps.deploy.outcome }}" == "success" ]]; then echo "✅ Deployment completed successfully" elif [[ "${{ steps.deploy.outcome }}" == "skipped" ]]; then - if [[ "${{ env.total_additions }}" -le 100 ]]; then - echo "⏭️ Deployment was skipped: PR has ${{ env.total_additions }} additions (threshold: 100)" + if [[ "${{ needs.build.outputs.total_additions }}" -le 100 ]]; then + echo "⏭️ Deployment was skipped: PR has ${{ needs.build.outputs.total_additions }} additions (threshold: 100)" elif [[ "${{ github.actor }}" == "dependabot[bot]" ]]; then echo "⏭️ Deployment was skipped: PR is from dependabot" else