Skip to content

chore(action): run pr checks on single workflow#3

Merged
georgeciubotaru merged 42 commits intomainfrom
feat/single-workflow
Mar 31, 2026
Merged

chore(action): run pr checks on single workflow#3
georgeciubotaru merged 42 commits intomainfrom
feat/single-workflow

Conversation

@teodorus-nathaniel
Copy link
Copy Markdown
Collaborator

@teodorus-nathaniel teodorus-nathaniel commented Mar 26, 2026

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@4d60fb47db98189d8adab64d61364ca43fb4be20 to holdex/github-actions/.github/actions/base/checkout@main

its needed now because there is no checkout action in main branch

Changes

  • Backward compatible usage, user can still use workflow run, but its much more efficient (using single workflow instead of multiple, run checks on changed files, setup runtime once)
  • User can pick and choose actions to use as composite

Summary by CodeRabbit

Release Notes

  • New Features

    • Added reusable composite GitHub Actions for code quality checks: commit validation, markdown linting, and formatting verification
    • Added support for selecting between Bun and pnpm package managers across all CI checks
  • Documentation

    • Updated workflow integration guides with pinned commit references and composite action usage examples
  • Style

    • Modified text wrapping configuration in code formatting settings

@holdex
Copy link
Copy Markdown

holdex bot commented Mar 26, 2026

Time Submission Status

Member Status Time Action Last Update
teodorus-nathaniel ✅ Submitted 5h Update time Mar 31, 2026, 8:02 AM
zolotokrylin ✅ Submitted 15min Update time Mar 31, 2026, 8:02 AM
georgeciubotaru ✅ Submitted 15min Update time Mar 31, 2026, 8:02 AM

You can submit time with the command. Example:

@holdex pr submit-time 15m

See available commands to help comply with our Guidelines.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 26, 2026

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Extracts 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

Cohort / File(s) Summary
New Composite Actions
.github/actions/commit-check/action.yml, .github/actions/markdown-check/action.yml, .github/actions/prettier/action.yml
Three new composite actions for validating commits, linting Markdown, and checking Prettier formatting. Each handles runtime setup (bun or pnpm), tool installation, config detection, and conditional execution based on changed files or config presence.
Refactored Workflows
.github/workflows/commit-check.yml, .github/workflows/markdown-check.yml, .github/workflows/prettier.yml, .github/workflows/pr-checks.yml
Simplified workflows now delegate check logic to composite actions. pr-checks.yml combines multiple jobs into a single consolidated job with package-manager input passed to each action.
Documentation
README.md
Updated usage examples to pin reusable workflows by commit SHA, documented package-manager input option, added direct composite action usage pattern, and clarified that checks now run on changed files.
Configuration
.prettierrc
Removed proseWrap: "always" option.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • zolotokrylin
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly describes the main change: consolidating multiple PR checks into a single workflow for improved efficiency.
Linked Issues check ✅ Passed All code changes directly address #307 objectives: grouping multiple check tasks into a single job, consolidating runtime setup, and reducing compute credit usage through workflow consolidation.
Out of Scope Changes check ✅ Passed All changes are in-scope: new composite actions, refactored workflows to use single consolidated job, and .prettierrc update aligns with PR objectives. No unrelated changes detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/single-workflow

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between ada5d79 and b26abfe.

📒 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.yml
  • README.md

Comment thread .github/actions/commit-check/action.yml Outdated
Comment thread .github/actions/markdown-check/action.yml Outdated
Comment thread .github/actions/prettier/action.yml Outdated
Comment thread .github/actions/prettier/action.yml Outdated
Comment thread .github/workflows/pr-checks.yml
Comment thread .github/workflows/pr-checks.yml Outdated
Comment thread README.md Outdated
@teodorus-nathaniel teodorus-nathaniel marked this pull request as draft March 26, 2026 14:34
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
README.md (1)

70-95: ⚠️ Potential issue | 🟡 Minor

Section title says pr-checks but example uses prettier action.

The "Combined Action Example (pr-checks)" should demonstrate the pr-checks composite action, not the prettier action.

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

📥 Commits

Reviewing files that changed from the base of the PR and between b26abfe and 4cbc3a5.

📒 Files selected for processing (5)
  • .github/actions/markdown-check/action.yml
  • .github/actions/pr-checks/action.yml
  • .github/actions/prettier/action.yml
  • .prettierrc
  • README.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

@teodorus-nathaniel teodorus-nathaniel marked this pull request as ready for review March 26, 2026 15:16
@teodorus-nathaniel
Copy link
Copy Markdown
Collaborator Author

@holdex pr submit-time 3h

@teodorus-nathaniel teodorus-nathaniel marked this pull request as ready for review March 27, 2026 14:59
@teodorus-nathaniel
Copy link
Copy Markdown
Collaborator Author

@zolotokrylin updated the structure
now the user must call:

      - uses: holdex/github-actions/.github/actions/base/checkout@main
        with:
          ref: <commit-sha>

before they use the other actions in this repo.
this is the best way I can find to have consistent versioning for calling another action from an action.

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.
the only way was to call with full name, holdex/github-actions/.github/....@<commit-sha/main/v1>

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
if we wanna use main, its a problem, because clients might face issue if we somehow update the code to not be backward compatible
if we wanna use v1, its best way, we can change to v2 if we introduce something not backward compatible, but still not that convenient.

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.

@teodorus-nathaniel teodorus-nathaniel marked this pull request as draft March 27, 2026 15:21
@teodorus-nathaniel
Copy link
Copy Markdown
Collaborator Author

log: checking backward compatibility of pr-checks

@teodorus-nathaniel
Copy link
Copy Markdown
Collaborator Author

tested on defy-api repo:
https://github.com/holdex-defy/defy-api/actions/runs/23654258308

pr-checks -> old way, using pr-checks shared workflow
checks -> new way, composite actions

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

@teodorus-nathaniel teodorus-nathaniel marked this pull request as ready for review March 27, 2026 15:36
@zolotokrylin
Copy link
Copy Markdown
Member

I will let @georgeciubotaru to review the code.

@georgeciubotaru
Copy link
Copy Markdown
Contributor

Log: reviewing the code

@georgeciubotaru
Copy link
Copy Markdown
Contributor

@teodorus-nathaniel please run locally the lint and formating. I will approve after

@teodorus-nathaniel
Copy link
Copy Markdown
Collaborator Author

@georgeciubotaru its formatted already

@georgeciubotaru
Copy link
Copy Markdown
Contributor

@holdex pr submit-time 15m

@georgeciubotaru georgeciubotaru merged commit 87c186b into main Mar 31, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants