fix(ci): fix commit message check and summary job name keys#3
Merged
LucienSong merged 2 commits intocopilot/add-github-actions-pr-review-workflowfrom Mar 23, 2026
Conversation
Co-authored-by: LucienSong <44640337+LucienSong@users.noreply.github.com> Agent-Logs-Url: https://github.com/ShellDAO/shell-chain/sessions/6930cd5f-0d8d-4d2b-97b0-13dff0279513
Copilot
AI
changed the title
[WIP] Fix commit message validation for auto-generated commits
fix(ci): fix commit message check and summary job name keys
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two bugs in
.github/workflows/pr-review.ymlcause the PR Review workflow to fail on PRs created by the Copilot coding agent.Changes
commit-message-check: Add a skip for commits whose subject is exactly"Initial plan"or"Initial commit"— auto-generated by the Copilot agent and not subject to conventional commit enforcement.summaryjob: Fix job name keys in theforloop — they used underscores (security_audit,commit_message_check,pr_description_check) but theneedscontext keys mirror the YAML job IDs which use hyphens. The mismatch caused those jobs to always resolve asunknown, silently masking real failures.Type of Change
Checklist
cargo fmtpasses)cargo clippy -- -D warningspasses)cargo testpasses)cargo doc --no-depspasses)feat:,fix:,chore:)Related Issues
Relates to #2
Additional Notes
No source code changes — workflow YAML only.
Original prompt
Problem
The PR Review workflow in PR #2 (branch
copilot/add-github-actions-pr-review-workflow) is failing. The workflow run at https://github.com/ShellDAO/shell-chain/actions/runs/23417589365 showsconclusion: failure.Root Cause Analysis
There are two bugs in
.github/workflows/pr-review.ymlthat need to be fixed:Bug 1: Commit Message Check fails on Copilot agent's "Initial plan" commit
The
commit-message-checkjob validates ALL commits betweenbase.shaandhead.shausinggit log --format="%s" "${BASE_SHA}..${HEAD_SHA}".The PR has 2 commits:
45aaaa5— message:"Initial plan"(created automatically by Copilot coding agent)cd98c9e— message:"ci: add automated PR review workflow, PR template, and script header"(actual work commit)The first commit
"Initial plan"does NOT follow conventional commit format and fails the check.Fix: The commit message validation script should also skip commits that are auto-generated by bots/agents (e.g., messages like "Initial plan" from Copilot coding agent). The simplest robust fix is to make the regex pattern also skip known bot-generated commit messages. A better approach: also skip commits where the message is exactly "Initial plan" (a known Copilot agent auto-commit). Alternatively and more robustly, add a pattern to also skip commits containing "Agent-Logs-Url" in the full message body OR whose subject is "Initial plan".
The best approach: In the
commit-message-checkjob, modify the validation script to:git log --format="%s" "${BASE_SHA}..${HEAD_SHA}"as before but also skip commits whose subject line matches known automated bot patterns like"Initial plan","Initial commit", or any message starting with"Merge "(already handled)."Initial plan"or"Initial commit".Here's the specific change needed in the validation script (the
whileloop):Bug 2: Summary job uses wrong job name keys
In the
summaryjob's "Check all jobs passed" step, the Python script iterates over job names using underscores:But the
needscontext from GitHub Actions uses the YAML job IDs which contain hyphens (not underscores):security-audit(notsecurity_audit)commit-message-check(notcommit_message_check)pr-description-check(notpr_description_check)So the Python lookup
data['security_audit']will never find the keysecurity-audit, causing those jobs to reportunknownstatus instead of detecting failures.Fix: Change the
forloop to use the correct hyphenated job names:And update the Python script to handle hyphenated keys properly (they need to be passed as strings, not bare shell variables with hyphens):
Actually, since
$jobcontains hyphens and is substituted as a string literal inside the Python code, it should work fine as'$job'already wraps it in quotes. The issue is just the underscore vs hyphen mismatch in the bashforloop.Files to modify
Only one file needs to be changed:
.github/workflows/pr-review.ymlSummary of changes needed
In the
commit-message-checkjob's "Validate conventional commit messages" step, add a skip for"Initial plan"and"Initial commit"messages (right after the existing merge commit skip).In the
summaryjob's "Check all jobs passed" step, change theforloop from:to:
Make sure the commit message for this fix follows conventional commit format, e.g.:
fix(ci): fix commit message check and summary job name keysThe following is the prior conversation context from the user's chat exploration (may be truncated):
User: @ShellDAO/shell-chain/pull/2 PR review 没有通过,你去修复
Assistant:
Let me first look at the PR details and understand what failed in the review.
Assistant: 我已经找到了失败的原因。让我查看具体的 workflow 文件中 summary job 的逻辑,确认所有需要修复的问题。
Assistant: 我已经找到了 CI 失败的根本原因。让我来分析并创建修复 PR。
🔍 失败原因分析
PR Review workflow run 失败在 Commit Message Check job。
错误日志:
PR #2 有 2 个 c...
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.