Skip to content

Commit 1256fa8

Browse files
committed
emit build fail comment in build_and_test action instead of build
1 parent c27bea0 commit 1256fa8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.github/actions/build_and_test_ya/action.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,16 @@ runs:
112112
link_threads: ${{ inputs.link_threads }}
113113
test_threads: ${{ inputs.test_threads }}
114114

115-
- name: Notify about fail build
116-
if: ${{ steps.build.outputs.success != 'true' }}
115+
- name: Notify about failed build
116+
if: ${{ steps.build.outputs.success != 'true' && inputs.run_tests == 'true' && inputs.run_tests_if_build_fails == 'false' }}
117117
shell: bash
118118
run: |
119119
echo 'Build failed. See the [build log](${{ steps.build.outputs.log_url }}).' >> $GITHUB_STEP_SUMMARY
120+
121+
if [[ "$GITHUB_EVENT_NAME" =~ ^pull_request ]]; then
122+
echo "Tests run skipped." | .github/scripts/tests/comment-pr.py --fail
123+
fi
124+
120125
exit 1
121126
122127
- name: comment-if-cancel

.github/actions/build_ya/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ runs:
138138
shell: bash
139139
run: |
140140
if [ "${{ steps.build.outputs.status }}" == "failed" ]; then
141-
echo "Build failed. see the [build log]($LOG_URL). Skipping tests run." | .github/scripts/tests/comment-pr.py --fail
141+
echo "Build failed. see the [build logs]($LOG_URL)." | .github/scripts/tests/comment-pr.py --fail
142142
else
143143
echo "Build successful." | .github/scripts/tests/comment-pr.py --ok
144144
fi

0 commit comments

Comments
 (0)