Skip to content

Conversation

@kotAPI
Copy link
Collaborator

@kotAPI kotAPI commented Sep 14, 2025

Summary by CodeRabbit

  • Chores
    • Upgraded CI Node.js runtime to v20 for improved performance and compatibility.
    • Streamlined Storybook/Chromatic workflow triggers to run only on relevant events and labels.
    • Removed an obsolete Storybook testing workflow to reduce duplication and maintenance overhead.
    • Minor formatting cleanups in CI configuration.
@changeset-bot
Copy link

changeset-bot bot commented Sep 14, 2025

⚠️ No Changeset found

Latest commit: 46e175a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 14, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Enables labeled pull_request triggers and refines gating logic in .github/workflows/chromatic.yml; upgrades Node setup action to v4 and Node.js to 20; removes the separate .github/workflows/test-storybook.yml workflow; includes minor formatting changes.

Changes

Cohort / File(s) Summary
Chromatic workflow update
.github/workflows/chromatic.yml
Enabled pull_request with types: [labeled]; added conditional gates for repository (rad-ui/ui) and event/label; upgraded actions/setup-node from v3 to v4; set Node version to 20; minor formatting adjustments including trailing newline.
Remove test-storybook workflow
.github/workflows/test-storybook.yml
Deleted workflow that previously handled Chromatic deployment (checkout, Node 18 setup, npm ci, Chromatic publish with CHROMATIC_PROJECT_TOKEN).

Sequence Diagram(s)

sequenceDiagram autonumber actor Dev as Developer participant GH as GitHub Events participant WF as chromatic.yml Workflow participant Job as chromatic job Dev->>GH: push to main OR label PR "deploy-storybook" GH-->>WF: Trigger evaluation alt repo == rad-ui/ui AND (push OR (pull_request labeled "deploy-storybook")) WF->>Job: Start job Job->>Job: actions/checkout@vX Job->>Job: setup-node@v4 (Node 20) Job->>Job: Install deps / run Chromatic Job-->>WF: Job complete else Gate not satisfied WF-->>GH: Skip job end note over WF,Job: Gating refined via github.event_name and github.event.label.name 
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

A bunny taps the label key,
“deploy-storybook,” swift and free.
One flow trimmed, another tuned,
Node hops to twenty, nicely pruned.
In burrows of YAML, neat and bright—
Chromatic springs to run on sight. 🐇✨

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kotapi/refactor-github-workflows-for-storybook

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c69ffd6 and 46e175a.

📒 Files selected for processing (2)
  • .github/workflows/chromatic.yml (2 hunks)
  • .github/workflows/test-storybook.yml (0 hunks)

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

@kotAPI kotAPI merged commit 39147cb into main Sep 14, 2025
9 checks passed
@kotAPI kotAPI deleted the kotapi/refactor-github-workflows-for-storybook branch September 14, 2025 08:56
Comment on lines 16 to 36
if: github.repository == 'rad-ui/ui' && (github.event_name == 'push' || github.event.label.name == 'deploy-storybook')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for Chromatic to retrieve git history

- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18' # Adjust this to your project's Node.js version
node-version: '20'

- name: Install dependencies
run: npm ci # Use 'yarn install --frozen-lockfile' if you use Yarn

- name: Publish to Chromatic
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
# Optional: Add any additional Chromatic CLI flags here
# For example: --exit-zero-on-changes
# For example: --exit-zero-on-changes

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 2 months ago

To resolve the issue, add a top-level permissions block to the workflow, specifying the least privilege required. In this case, placing permissions: contents: read after the name and before on: at the workflow root is recommended so it applies to all jobs (unless overridden). This change limits what the GITHUB_TOKEN can do, following least privilege principles.
Edit the .github/workflows/chromatic.yml file to insert the following lines after the name: line.

Suggested changeset 1
.github/workflows/chromatic.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -1,4 +1,6 @@ name: 'Chromatic Deployment' +permissions: + contents: read on: push: EOF
@@ -1,4 +1,6 @@
name: 'Chromatic Deployment'
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
@github-actions
Copy link
Contributor

Coverage

This report compares the PR with the base branch. “Δ” shows how the PR affects each metric.

Metric PR Δ
Statements 88.42% +0.00%
Branches 63.37% +0.00%
Functions 72.98% +0.00%
Lines 87.32% +0.00%

Coverage improved or stayed the same. Great job!

Run npm run coverage locally for detailed reports and target untested areas to raise these numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants