Skip to content

Commit a3d021d

Browse files
NIFI-15794 Changed single commit check to opened action
1 parent 44c8043 commit a3d021d

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

.github/scripts/build/validate-single-commit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ set -e
2121

2222
if [ "${COMMIT_COUNT}" -eq 1 ]; then
2323
echo "Pull request contains a single commit"
24-
else
24+
else if [ "${GITHUB_EVENT_ACTION}" == "opened" ]; then
2525
echo "::error::Pull request contains ${COMMIT_COUNT} commits. Squash commits into a single commit for initial review."
2626
exit 1
2727
fi

.github/workflows/build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,16 @@ jobs:
105105
continue-on-error: true
106106
env:
107107
COMMIT_COUNT: ${{ github.event.pull_request.commits }}
108+
GITHUB_EVENT_ACTION: ${{ github.event.action }}
108109
run: .github/scripts/build/validate-single-commit.sh
110+
- name: Evaluate Validation Results
111+
env:
112+
VALIDATION_FAILED: ${{ contains(steps.*.outcome, 'failure') }}
113+
run: |
114+
if [[ "${VALIDATION_FAILED}" == "true" ]]; then
115+
echo "::error::Pull request validation failed"
116+
exit 1
117+
fi
109118
110119
ubuntu-build-en:
111120
timeout-minutes: 120

0 commit comments

Comments
 (0)