-
Notifications
You must be signed in to change notification settings - Fork 0
fix: get PR title dynamically #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This should remove some confusion about checking a changed PR title
WalkthroughAdds a Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Runner as GitHub Actions Runner
participant Shell as Default shell
participant GHCLI as gh CLI
participant API as GitHub API
participant Committed as committed CLI
participant CSpell as npx cspell-cli
rect rgba(200,230,255,0.25)
Note over Runner: Job: check-pr-title
end
Runner->>Shell: steps.get-title -> gh pr view <pr_number> --json title
Shell->>GHCLI: request PR title
GHCLI->>API: GitHub API request
API-->>GHCLI: PR title
GHCLI-->>Shell: outputs.title set
rect rgba(220,255,220,0.25)
Note over Runner: Subsequent steps consume steps.get-title.outputs.title
end
Runner->>Shell: conventional-commit step reads PR_TITLE and COMMITTED_CONFIG
Shell->>Committed: pipe "$PR_TITLE" into committed --config "$COMMITTED_CONFIG"
Runner->>Shell: spell check step reads PR_TITLE
Shell->>CSpell: echo "$PR_TITLE" | npx cspell-cli lint --stdin
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.github/workflows/pre-commit.yml (1)
31-31: Prefer explicit $HOME over quoted ~ in cache path.Quoting may prevent tilde expansion by the cache action. Use ${{ env.HOME }} for portability.
Apply:
- path: "~/.cache/pre-commit" + path: ${{ env.HOME }}/.cache/pre-commit
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/pre-commit.yml(5 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/pre-commit.yml
68-68: receiver of object dereference "pr_number" must be type of object but got "string"
(expression)
🔇 Additional comments (3)
.github/workflows/pre-commit.yml (3)
58-62: Verify fallback operator support in expressions.Confirm that ${{ vars.NUSHELL_VERSION || '*' }} is valid in your org runners. If not, prefer a conditional expression or default via env.
Example fallback:
- version: ${{ vars.NUSHELL_VERSION || '*' }} + version: ${{ vars.NUSHELL_VERSION != '' && vars.NUSHELL_VERSION || '*' }}
85-88: Confirm committed’s stdin usage.Ensure committed supports --commit-file - with stdin (some versions require a real file).
If needed:
- run: $env.PR_TITLE | ^committed --config $env.COMMITTED_CONFIG --commit-file - + run: $"($env.PR_TITLE)" | save pr_title.txt; ^committed --config $env.COMMITTED_CONFIG --commit-file pr_title.txt
22-22: LGTM on Python version matrix.Using "3.x" keeps runners up-to-date across 3.x releases.
|
@shenxianpeng This will allow re-running the "Check PR title" job when the PR title has changed without any new CI event trigger. 😉 |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
This should remove some confusion about checking a changed PR title
Summary by CodeRabbit