This is an automated email from the ASF dual-hosted git repository.

pvillard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new 7075c48d09f NIFI-15811 Validated First Commit Message for Jira Issue 
Number (#11122)
7075c48d09f is described below

commit 7075c48d09fb9931db46edefd5cff0a86006bc84
Author: David Handermann <[email protected]>
AuthorDate: Thu Apr 9 16:38:21 2026 -0500

    NIFI-15811 Validated First Commit Message for Jira Issue Number (#11122)
    
    - Excluded dependabot from Validate Pull Request step in build workflow
---
 .github/scripts/build/validate-commit-messages.sh | 21 ++++++++++-----------
 .github/workflows/build.yml                       |  7 ++++---
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/.github/scripts/build/validate-commit-messages.sh 
b/.github/scripts/build/validate-commit-messages.sh
index 840f74fb65a..f5cbdf52219 100755
--- a/.github/scripts/build/validate-commit-messages.sh
+++ b/.github/scripts/build/validate-commit-messages.sh
@@ -16,19 +16,18 @@
 
 set -e
 
-INVALID=0
-COMMITS=$(gh api "repos/${REPOSITORY}/pulls/${PR_NUMBER}/commits" --jq 
'.[].commit.message | split("\n") | .[0]')
+COMMITS_JSON=$(gh api "repos/${REPOSITORY}/pulls/${PR_NUMBER}/commits")
+FIRST_LINE=$(echo "${COMMITS_JSON}" | jq -r 'if length > 0 then 
.[0].commit.message | split("\n") | .[0] else empty end')
 
-while IFS= read -r FIRST_LINE; do
-  if ! echo "${FIRST_LINE}" | grep -qP '^NIFI-[1-9][0-9]+'; then
-    echo "::error::Commit message does not start with Apache NiFi Jira issue 
number: ${FIRST_LINE}"
-    INVALID=1
-  fi
-done <<< "${COMMITS}"
+if [ -z "${FIRST_LINE}" ]; then
+  echo "::error::No commits found for pull request"
+  exit 1
+fi
 
-if [ "${INVALID}" -eq 1 ]; then
-  echo "::error::All commit messages must start with an Apache NiFi Jira issue 
number such as NIFI-00000"
+if ! echo "${FIRST_LINE}" | grep -qP '^NIFI-[1-9][0-9]+'; then
+  echo "::error::First commit message does not start with Apache NiFi Jira 
issue number: ${FIRST_LINE}"
+  echo "::error::The first commit message must start with an Apache NiFi Jira 
issue number such as NIFI-00000"
   exit 1
 fi
 
-echo "All commit messages start with a valid Apache NiFi Jira issue number"
+echo "The first commit message starts with a valid Apache NiFi Jira issue 
number"
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 7845715b8ee..265e96c8250 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -60,7 +60,7 @@ jobs:
     timeout-minutes: 10
     runs-on: ubuntu-24.04
     name: Validate Pull Request
-    if: github.event_name == 'pull_request' && github.repository == 
'apache/nifi'
+    if: github.event_name == 'pull_request' && github.repository == 
'apache/nifi' && github.actor != 'dependabot[bot]'
     steps:
       - name: Checkout Code
         uses: actions/checkout@v6
@@ -107,12 +107,13 @@ jobs:
           COMMIT_COUNT: ${{ github.event.pull_request.commits }}
           GITHUB_EVENT_ACTION: ${{ github.event.action }}
         run: .github/scripts/build/validate-single-commit.sh
-      - name: Evaluate Validation Results
+      - name: Validation Results
         env:
           VALIDATION_FAILED: ${{ contains(steps.*.outcome, 'failure') }}
         run: |
           if [[ "${VALIDATION_FAILED}" == "true" ]]; then
-            echo "::error::Pull request validation failed"
+            
RUN_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
+            echo "::error::Pull request validation failed. Review workflow 
run: ${RUN_URL}"
             exit 1
           fi
 

Reply via email to