Skip to content

Commit ee20334

Browse files
fix(ci): ignore false [skip-build] matches in PR image check
Use --first-parent and match subject-line skip tags only so merged main chore commits and fix commit prose do not skip the PR image build. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 07203e8 commit ee20334

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/actions/check-image-and-changes/action.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ runs:
4141
echo "Changed files:"
4242
echo "$CHANGED_FILES"
4343
44-
# Check for [skip-build] tag in commit messages
44+
# Check for [skip-build] on PR commits only. Without --first-parent, merge
45+
# refs pull in main chore commits like "update rpms.lock.yaml [skip-build]".
46+
# Match subject-line tags only (not body text or mid-subject mentions).
4547
SKIP_BUILD_TAG=false
46-
if git log --format=%B "$BASE_COMMIT"..HEAD | grep -qF "[skip-build]"; then
48+
if git log --first-parent --format=%s "$BASE_COMMIT"..HEAD | grep -qE '\[skip-build\](\s*\[skip-e2e\])?(\s*\(#\d+\))?$'; then
4749
echo "Found [skip-build] tag in commit messages."
4850
SKIP_BUILD_TAG=true
4951
fi

0 commit comments

Comments
 (0)