chore(action): run pr checks on single workflow#3
Conversation
Time Submission Status
You can submit time with the command. Example: See available commands to help comply with our Guidelines. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughExtracts lint and formatting check logic from individual workflows into reusable composite GitHub Actions, consolidates multiple PR-check jobs into a single job, adds configurable package-manager selection (bun/pnpm support), and updates workflows to invoke these new actions instead of inline steps. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/actions/commit-check/action.yml:
- Around line 23-31: The current step with id commitlint-config manually checks
specific filenames and misses other valid commitlint configs; update it to
detect config using commitlint's own resolution (e.g., invoke commitlint CLI
like `commitlint --show-rules` or use its cosmiconfig resolution) instead of
grepping filenames — replace the file checks in the run block so the step
executes commitlint's config detection and sets has-config=true on success and
has-config=false on failure, keeping the step id commitlint-config and
preserving the same output variable behavior.
In @.github/actions/markdown-check/action.yml:
- Around line 21-75: Move the "Resolve changed markdown files" logic (steps
using id resolved-markdown-files and changed-markdown-files) to run before the
"Setup runtime" step (the setup-runtime action) so the workflow can
short-circuit early; then guard the "Install rumdl" step so it only runs when
resolved-markdown-files.outputs.any-changed == 'true' (or use the same
conditional used in "Skip when no markdown files changed") to avoid installing
tools when no Markdown files changed. Ensure the Get changed-markdown-files step
stays adjacent to resolved-markdown-files and update the Install rumdl step's if
condition to check the resolved-markdown-files output rather than running
unconditionally.
In @.github/actions/prettier/action.yml:
- Around line 45-89: Resolve changed files first and then skip expensive
setup/install when nothing changed: move or ensure the "Resolve changed files"
step (id: resolved-files) runs before runtime/tooling, and add an if condition
gating the "Setup runtime" step (uses: ./.github/actions/setup-runtime), the
"Install Prettier" step, and the "Install dependencies" step so they only run
when steps.resolved-files.outputs.any-changed == 'true' (use if:
steps.resolved-files.outputs.any-changed == 'true'); also update the "Get
changed files" step logic so resolved-files always has the necessary outputs
when inputs.changed-files is empty.
- Around line 21-43: The current "prettier-config" step uses the CONFIG_FILES
list to detect Prettier config and misses package.json; replace that manual
check by delegating discovery to Prettier itself (e.g., run Prettier via npx or
installed binary with --check/--find-config-path across the repo) so Prettier
auto-discovers package.json/"prettier" field and other supported config
locations, fail the step when Prettier returns non-zero, and update any output
variable (e.g., has-config) accordingly; locate the logic in the step with id
"prettier-config" and the CONFIG_FILES variable to implement this change.
In @.github/workflows/pr-checks.yml:
- Around line 28-31: The job unconditionally runs and performs
actions/checkout@v4 even for draft PRs; add a job-level conditional to skip the
entire "checks" job for draft pull requests by adding an if: condition using
github.event.pull_request.draft (e.g., if: github.event.pull_request == null ||
github.event.pull_request.draft == false) on the checks job so the runner and
checkout step are not started for drafts.
- Around line 31-34: The reusable workflow uses a local action path ("uses:
./.github/actions/pr-checks") which will fail for external callers; fix by
adding an explicit checkout of this workflow repository with actions/checkout@v4
(specifying repository: and path:) before referencing the local action, and then
update the "uses: ./.github/actions/pr-checks" invocation to the checked-out
path so external consumers can resolve the action.
In `@README.md`:
- Around line 70-89: Update the example so it actually demonstrates the combined
`pr-checks` action instead of calling the Prettier action: replace the uses:
entry that currently references
holdex/github-actions/.github/actions/prettier@<commit-sha> with the `pr-checks`
action invocation and remove the Prettier-specific input `setup-runtime`; ensure
the example shows the correct inputs for `pr-checks` (e.g., any API-related
inputs documented elsewhere) so the snippet under "Combined Action Example
(`pr-checks`)" runs the `pr-checks` workflow rather than Prettier.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4a9fd9a7-5c10-4fda-bd75-ad0020de3b5a
📒 Files selected for processing (10)
.github/actions/commit-check/action.yml.github/actions/markdown-check/action.yml.github/actions/pr-checks/action.yml.github/actions/prettier/action.yml.github/actions/setup-runtime/action.yml.github/workflows/commit-check.yml.github/workflows/markdown-check.yml.github/workflows/pr-checks.yml.github/workflows/prettier.ymlREADME.md
There was a problem hiding this comment.
♻️ Duplicate comments (1)
README.md (1)
70-95:⚠️ Potential issue | 🟡 MinorSection title says
pr-checksbut example usesprettieraction.The "Combined Action Example (
pr-checks)" should demonstrate thepr-checkscomposite action, not theprettieraction.Suggested fix
- uses: actions/checkout@v4 - - uses: holdex/github-actions/.github/actions/prettier@<commit-sha> + - uses: holdex/github-actions/.github/actions/pr-checks@<commit-sha> with: package-manager: pnpm - setup-runtime: "true"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 70 - 95, The example under "Combined Action Example (`pr-checks`)" incorrectly demonstrates the Prettier composite action; update the workflow snippet so the step uses the pr-checks composite action instead of the prettier action (replace the uses value "holdex/github-actions/.github/actions/prettier@<commit-sha>" with the pr-checks action reference, or change the section title to match the actual action used) and ensure the step name and inputs reflect the pr-checks composite action (refer to the section title `pr-checks` and the existing uses string to locate the line to change).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@README.md`:
- Around line 70-95: The example under "Combined Action Example (`pr-checks`)"
incorrectly demonstrates the Prettier composite action; update the workflow
snippet so the step uses the pr-checks composite action instead of the prettier
action (replace the uses value
"holdex/github-actions/.github/actions/prettier@<commit-sha>" with the pr-checks
action reference, or change the section title to match the actual action used)
and ensure the step name and inputs reflect the pr-checks composite action
(refer to the section title `pr-checks` and the existing uses string to locate
the line to change).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: dc5d487c-d191-471c-b3da-3200f4434823
📒 Files selected for processing (5)
.github/actions/markdown-check/action.yml.github/actions/pr-checks/action.yml.github/actions/prettier/action.yml.prettierrcREADME.md
💤 Files with no reviewable changes (1)
- .prettierrc
🚧 Files skipped from review as they are similar to previous changes (2)
- .github/actions/prettier/action.yml
- .github/actions/markdown-check/action.yml
|
@holdex pr submit-time 3h |
|
@zolotokrylin updated the structure before they use the other actions in this repo. if you want more detail, read below Issue was, github actions cannot call local action with relative paths, because the action will run on different repo. if we wanna use commit-sha, its a bit annoying as we need to have the input "ref" in all the actions and pass them so I use this way, where the user fetches this repo to their app with the specified commit sha into .holdex-actions folder, then the actions are being called locally from there. |
|
log: checking backward compatibility of pr-checks |
|
tested on defy-api repo: pr-checks -> old way, using pr-checks shared workflow consumer's action file: name: PR Checks
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
jobs:
pr-checks:
uses: holdex/github-actions/.github/workflows/pr-checks.yml@4265e6449357b9a86a42bea3b77d49576a37ce29
with:
package-manager: bun
run-prettier: true
run-markdown: false
run-commits: true
ref: 4265e6449357b9a86a42bea3b77d49576a37ce29 # this and the @ above is using static hash, but for backward compatibility, this ref defaults to main
checks:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: holdex/github-actions/.github/actions/base/checkout@5d652c128c2e34b2d3966d13f295e5fa4ed29d0b
with:
ref: 5d652c128c2e34b2d3966d13f295e5fa4ed29d0b
- uses: ./.holdex-actions/.github/actions/base/setup-runtime
with:
package-manager: bun
- uses: ./.holdex-actions/.github/actions/composed/pr-checks
with:
run-prettier: true
run-markdown: false
run-commits: true
package-manager: bun
- run: bun install --frozen-lockfile
- run: bun run typecheck |
|
I will let @georgeciubotaru to review the code. |
|
Log: reviewing the code |
|
@teodorus-nathaniel please run locally the lint and formating. I will approve after |
|
@georgeciubotaru its formatted already |
|
@holdex pr submit-time 15m |
resolves https://github.com/holdex/wizard/issues/1096
example run: https://github.com/holdex/github-actions/actions/runs/23602194375/job/68734999379?pr=3
Note Before Merge:
Need to update pr-checks.yml,
holdex/github-actions/.github/actions/base/checkout@4d60fb47db98189d8adab64d61364ca43fb4be20toholdex/github-actions/.github/actions/base/checkout@mainits needed now because there is no checkout action in main branch
Changes
Summary by CodeRabbit
Release Notes
New Features
Documentation
Style