Skip to content

Commit 3f2453b

Browse files
authored
Update merge-train-create-pr.yml
1 parent 91cc5e5 commit 3f2453b

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/merge-train-create-pr.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,19 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
17+
with:
18+
fetch-depth: 0
1719

1820
- name: Check if PR exists and create if needed
1921
env:
2022
GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
2123
run: |
2224
branch="${{ github.ref_name }}"
2325
24-
# Skip if this is a merge commit
25-
if [[ "${{ github.event.head_commit.message }}" == "Merge "* ]]; then
26-
echo "Skipping: This is a merge commit"
26+
# Skip if this is a merge commit (check for multiple parents)
27+
parent_count=$(git rev-list --parents -n 1 "${{ github.sha }}" | wc -w)
28+
if [[ $parent_count -gt 2 ]]; then
29+
echo "Skipping: This is a merge commit."
2730
exit 0
2831
fi
2932

0 commit comments

Comments
 (0)