This is an automated email from the ASF dual-hosted git repository.
zhengruifeng pushed a commit to branch branch-4.x
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-4.x by this push:
new c005b212d916 [MINOR][4.X][INFRA] Explain skipped post-merge Build runs
c005b212d916 is described below
commit c005b212d916333c5be2da3caae1d8950130125d
Author: Ruifeng Zheng <[email protected]>
AuthorDate: Fri Aug 7 21:13:24 2026 +0800
[MINOR][4.X][INFRA] Explain skipped post-merge Build runs
### What changes were proposed in this pull request?
Rename the commit-count job in build_main.yml to check-commit-count and
make it expose a should-run boolean. The job only checks whether the full
branch commit count is divisible by ten.
The downstream Run job uses should-run together with the existing
repository condition, keeping repository-specific behavior outside
check-commit-count.
The count step prints the branch, commit SHA, commit count, remainder,
boolean result, and explanation. It publishes the same information as a GitHub
job summary and notice, with a check-mark or pause icon indicating whether the
count matched.
### Why are the changes needed?
When the commit-count check succeeds but the Run job is skipped, GitHub
marks the overall workflow run green. Previously, the commit count was
redirected only to a job output, so the run did not visibly explain why the
Build job was skipped.
An explicit boolean keeps the downstream condition readable, while the job
summary makes the cadence decision visible without inspecting the workflow
source.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Ran git diff --check and bash syntax validation for the count script. Also
checked the changed workflow for non-ASCII characters and lines over 100
characters.
No runtime tests were run because this changes only GitHub Actions
orchestration and reporting.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex (GPT-5)
Closes #57853 from zhengruifeng/explain-skipped-branch-4.x-build-dev1.
Authored-by: Ruifeng Zheng <[email protected]>
Signed-off-by: Ruifeng Zheng <[email protected]>
---
.github/workflows/build_main.yml | 47 ++++++++++++++++++++++++++++++++--------
1 file changed, 38 insertions(+), 9 deletions(-)
diff --git a/.github/workflows/build_main.yml b/.github/workflows/build_main.yml
index 0765b36f7e58..9622901fa813 100644
--- a/.github/workflows/build_main.yml
+++ b/.github/workflows/build_main.yml
@@ -25,30 +25,59 @@ on:
- '**'
jobs:
- count-commits:
- name: Count commits
+ check-commit-count:
+ name: Check commit count
runs-on: ubuntu-slim
permissions:
contents: read
outputs:
- commit-count: ${{ steps.count.outputs.commit-count }}
+ should-run: ${{ steps.count.outputs.should-run }}
steps:
- name: Check out the full branch history
uses: actions/checkout@v6
with:
fetch-depth: 0
- - name: Count commits on the pushed branch
+ - name: Check whether this is every tenth commit
id: count
- run: echo "commit-count=$(git rev-list --count HEAD)" >>
"$GITHUB_OUTPUT"
+ run: |
+ count=$(git rev-list --count HEAD)
+ remainder=$((count % 10))
+
+ if ((remainder == 0)); then
+ should_run=true
+ icon=":white_check_mark:"
+ title="Commit count matched"
+ details="Commit count $count is divisible by 10."
+ else
+ should_run=false
+ icon=":pause_button:"
+ title="Commit count not matched"
+ details="Commit count $count is not divisible by 10."
+ fi
+
+ echo "should-run=$should_run" >> "$GITHUB_OUTPUT"
+ echo "Branch: $GITHUB_REF_NAME"
+ echo "Commit: $GITHUB_SHA"
+ echo "Commit count: $count"
+ echo "Remainder: $remainder"
+ echo "Should run: $should_run"
+ echo "Details: $details"
+ echo "::notice title=$title::$details"
+ echo "### $icon Commit count check" >> "$GITHUB_STEP_SUMMARY"
+ echo "" >> "$GITHUB_STEP_SUMMARY"
+ echo "- Branch: $GITHUB_REF_NAME" >> "$GITHUB_STEP_SUMMARY"
+ echo "- Commit: $GITHUB_SHA" >> "$GITHUB_STEP_SUMMARY"
+ echo "- Commit count: $count" >> "$GITHUB_STEP_SUMMARY"
+ echo "- Remainder: $remainder" >> "$GITHUB_STEP_SUMMARY"
+ echo "- Should run: $should_run" >> "$GITHUB_STEP_SUMMARY"
+ echo "- Details: $details" >> "$GITHUB_STEP_SUMMARY"
call-build-and-test:
permissions:
packages: write
name: Run
- needs: count-commits
- # GitHub Actions expressions do not support modulo. A non-negative decimal
- # count is divisible by ten when it ends in 0.
+ needs: check-commit-count
if: >-
github.repository != 'apache/spark'
- || endsWith(needs.count-commits.outputs.commit-count, '0')
+ || needs.check-commit-count.outputs.should-run == 'true'
uses: ./.github/workflows/build_and_test.yml
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]