ci: add automated PR review GitHub Actions workflow#2
Merged
LucienSong merged 2 commits intomainfrom Mar 23, 2026
Merged
Conversation
Co-authored-by: LucienSong <44640337+LucienSong@users.noreply.github.com> Agent-Logs-Url: https://github.com/ShellDAO/shell-chain/sessions/e0ed7d1b-8abd-4175-92ee-12c05aeffdd7
Copilot
AI
changed the title
[WIP] Add GitHub Actions workflow for automated PR reviews
ci: add automated PR review GitHub Actions workflow
Mar 23, 2026
7 tasks
6 tasks
LucienSong
added a commit
to LucienSong/shell-chain
that referenced
this pull request
Mar 25, 2026
…s-pr-review-workflow ci: add automated PR review GitHub Actions workflow
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.
Overview
No
.github/workflows/directory existed — all checks inscripts/pr-review-checks.shwere manual-only with no CI enforcement. This adds a full automated PR review pipeline triggered onpull_request(opened,synchronize,reopened) targetingmain..github/workflows/pr-review.yml— 9 parallel jobs:formatcargo fmt -- --checklintcargo clippy -- -D warningstestcargo testdocscargo doc --no-depssecurity-auditcargo auditbuildcargo build --releasecommit-message-checkpr-description-checksummaryAll Rust jobs skip gracefully when
Cargo.tomlis absent. Includesconcurrencycancel-on-push,actions/cache@v4for Cargo, and minimalGITHUB_TOKENpermissions (contents: readglobally;{}on non-checkout jobs)..github/pull_request_template.md— standard GitHub-recognized template filename (distinct from the existingPR_REVIEW_TEMPLATE.mdreference doc); auto-populates new PR descriptions with Overview, Type of Change, Checklist, Related Issues, and Additional Notes sections.scripts/pr-review-checks.sh— header comment added noting it mirrors the Actions workflow and can be used locally for pre-push validation.Type of Change
Checklist
cargo fmtpasses)cargo clippy -- -D warningspasses)cargo testpasses)cargo doc --no-depspasses)feat:,fix:,chore:)Related Issues
Additional Notes
CodeQL
missing-workflow-permissionsalerts were resolved by settingpermissions: contents: readat workflow level andpermissions: {}on jobs that don't need repository access (pr-description-check,summary).Original prompt
Background
The repository currently has several static PR review documents and a manual shell script, but no GitHub Actions workflow to automatically trigger reviews when a PR is opened or updated.
Existing files:
.github/PR_REVIEW_TEMPLATE.md— static PR review template (manual checklist).github/REVIEW_CHECKLIST.md— review checklist reference document.github/RUST_CRYPTO_REVIEW.md— Rust and cryptography review guidelines.github/CODEOWNERS— code owners (@LucienSong)scripts/pr-review-checks.sh— local shell script that runs cargo fmt/clippy/test/doc/audit/build, but is never automatically triggeredProblem
There is no
.github/workflows/directory and no CI/CD automation. Thescripts/pr-review-checks.shscript must be run manually. We need an automated workflow.Requirements
1. Create
.github/workflows/pr-review.ymlA GitHub Actions workflow that triggers on
pull_requestevents (opened,synchronize,reopened) targeting themainbranch. It should run the following checks as separate jobs or well-organized steps:a. Formatting Check
cargo fmt -- --checkto verify code formattingb. Lint Check
cargo clippy -- -D warningsto catch common mistakes and enforce best practicesc. Tests
cargo testto execute all unit and integration testsd. Documentation Build
cargo doc --no-depsto verify documentation builds successfullye. Security Audit
cargo auditto check for known vulnerabilities in dependenciesf. Build Verification
cargo build --releaseto verify the release build succeedsg. Commit Message Check
feat:,fix:,chore:,docs:,refactor:,test:,ci:)h. PR Description Check
Workflow configuration details:
ubuntu-latestrunneractions/cacheorSwatinem/rust-cache)2. Create
.github/pull_request_template.mdA standard GitHub pull request template file (this is the filename GitHub automatically recognizes, different from the existing
PR_REVIEW_TEMPLATE.mdwhich is just a reference document). When someone creates a new PR, GitHub will auto-populate the PR description with this template.The template should include:
3. Update
scripts/pr-review-checks.shAdd a header comment explaining that this script is now also run automatically via GitHub Actions, but can still be used locally for pre-push checks. No functional changes needed to the script itself.
Important Notes
Cargo.toml/Cargo.lockmight not exist yet (the repo is still in early stages) — consider adding a check or making certain steps conditionalThe following is the prior conversation context from the user's chat exploration (may be truncated):
User: 看看项目创建的自动化审核PR脚本和文档,好像不全,也不是我想要的。我想要一个当有PR提交或修改时自动触发的审核脚本
Assistant:
Let me first look at the existing automation scripts and documentation in the repository.
Assistant: 我已经查看了项目中所有现有的审核相关文件。以下是现状分析:
📋 现有文件分析
你的仓库目前有以下 PR 审核相关文件:
.github/PR_REVIEW_TEMPLATE.md.github/REVIEW_CHECKLIST.md.github/RUST_CRYPTO_REVIEW.md.github/CODEOWNERS@LucienSong)scripts/pr-review-checks.sh❌ 缺什么?
你说得对,关键缺失的是 GitHub Actions Workflow 文件(
.github/workflows/*.yml)。目前:scripts/pr-review-checks.sh只是一个手动执行的本地脚本,不会在 PR 提交/修改时自动触发.github/workflows/目录,也就没有任何 CI/CD 自动化.md文件只是静态文档,不会参与自动化流程✅ 你需要的
一个 GitHub Actions Workflow,在 PR 提交(opened) 或 修改(synchronize) 时自动触发,执行完整的审核检查。
要我帮你创建一个 PR,添加完整的自动化 PR 审核 workflow 吗?它会包含:
This pull request was created from Copilot chat.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.