mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 04:46:08 +00:00
CI: full history for the pull-request merge (the depth expression came out shallow), and git's own words when a merge cannot start
This commit is contained in:
1 parent
e228eca65e
commit
38df1e8141
1 file changed
+15
-1
@@ -59,7 +59,8 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
|
||||
fetch-depth: ${{ github.event_name == 'pull_request_target' && 0 || 1 }}
|
||||
# Full history: the merge below needs it (a shallow clone refuses to merge at all).
|
||||
fetch-depth: 0
|
||||
|
||||
# The pull request as it would be once merged onto main is what gets built. When it cannot
|
||||
# be merged, the conflicting files and the conflicting hunks go into the run summary and the
|
||||
@@ -83,6 +84,19 @@ jobs:
|
||||
exit 0
|
||||
fi
|
||||
FILES=$(git diff --name-only --diff-filter=U)
|
||||
if [ -z "$FILES" ]; then
|
||||
# The merge did not even start (git said why): quote it rather than list nothing.
|
||||
{
|
||||
echo "### ❌ Could not merge onto main (\`$BASE\`)"
|
||||
echo
|
||||
echo '```'
|
||||
cat /tmp/merge.out
|
||||
echo '```'
|
||||
} > /tmp/pr-merge.md
|
||||
cat /tmp/pr-merge.md >> "$GITHUB_STEP_SUMMARY"
|
||||
echo "::error::git could not merge main: $(head -3 /tmp/merge.out | tr '\n' ' ')"
|
||||
exit 1
|
||||
fi
|
||||
{
|
||||
echo "### ❌ Not mergeable — conflicts with main (\`$BASE\`)"
|
||||
echo
|
||||
|
||||
Reference in new issue
Block a user