Skip to content

Commit

Permalink
[BE] Make merge conflict workflow failure case more descriptive (#4876)
Browse files Browse the repository at this point in the history
Co-authored-by: PaliC <>
Co-authored-by: Ivan Zaitsev <108101595+izaitsevfb@users.noreply.github.com>
  • Loading branch information
PaliC and izaitsevfb authored Jan 16, 2024
1 parent 292eb9d commit 3bec171
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/pr-dependencies-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ jobs:
for CONFLICT in "${CONFLICTING_COMMITS[@]}"; do
echo "- $(git show --oneline -s "$CONFLICT")" >> "$GITHUB_STEP_SUMMARY"
done
echo "::set-output name=conflicting_commits::${CONFLICTING_COMMITS[*]}"
echo "::set-output name=num_conflicting_commits::${#CONFLICTING_COMMITS[*]}"
{
echo ""
echo "---"
Expand Down Expand Up @@ -242,6 +243,12 @@ jobs:
- name: Fail if PR is Not Mergeable
if: ${{ steps.pr_merge_check.outputs.pr_is_mergeable == '0' }}
run: |
echo "The value --- ${{ steps.pr_merge_check.outputs.pr_is_mergeable }} --- == 0 but should be 1."
echo "Failing the job as PR_IS_MERGEABLE is not 0."
PR_NUMBER="${{ steps.extract_pr_number.outputs.pr_number }}"
CONFLICTING_COMMITS="${{ steps.pr_merge_check.outputs.conflicting_commits }}"
NUM_CONFLICTING_COMMITS="${{ steps.pr_merge_check.outputs.num_conflicting_commits }}"
echo "PR #$PR_NUMBER is NOT mergeable into main / revertable (if it is already merged) due to $NUM_CONFLICTING_COMMITS conflicting commits which are:"
for CONFLICT in $CONFLICTING_COMMITS; do
echo "- $(git show --oneline -s "$CONFLICT")"
done
echo "Please rebase your PR onto main and resolve the conflicts."
exit 1

0 comments on commit 3bec171

Please sign in to comment.