Skip to content

Commit

Permalink
workflows/check-by-name: print failed command output
Browse files Browse the repository at this point in the history
  • Loading branch information
Artturin committed Oct 17, 2023
1 parent e1a4c70 commit 5fbbada
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/check-by-name.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ jobs:
steps:
- name: Resolving the merge commit
run: |
if result=$(git ls-remote --exit-code ${{ github.event.pull_request.base.repo.clone_url }} refs/pull/${{ github.event.pull_request.number }}/merge); then
if result=$(git ls-remote --exit-code ${{ github.event.pull_request.base.repo.clone_url }} refs/pull/${{ github.event.pull_request.number }}/merge 2>&1); then
mergedSha=$(cut -f1 <<< "$result")
echo "The PR appears to not have any conflicts, checking the merge commit $mergedSha"
else
echo "The PR may have a merge conflict"
echo "'git ls-remote' output was:"
echo "$result"
exit 1
fi
echo "mergedSha=$mergedSha" >> "$GITHUB_ENV"
Expand Down

0 comments on commit 5fbbada

Please sign in to comment.