Skip to content

Conversation

adrianschmidt
Copy link
Contributor

@adrianschmidt adrianschmidt commented Oct 16, 2025

Summary by CodeRabbit

  • Chores
    • Added a manual trigger for the docs publishing workflow with version and force-push options.
    • Improved workflow conditions so build-only and publish steps run correctly for both manual and workflow-call invocations.
    • Environment variables for docs version and force-push now accept inputs from manual invocation or workflow_call with sensible fallbacks.
    • Adjusted post-link and build-only checks to respect workflow-call contexts.

Review:

  • Commits are atomic
  • Commits have the correct type for the changes made
  • Commits with breaking changes are marked as such

Browsers tested:

(Check any that applies, it's ok to leave boxes unchecked if testing something didn't seem relevant.)

Windows:

  • Chrome
  • Edge
  • Firefox

Linux:

  • Chrome
  • Firefox

macOS:

  • Chrome
  • Firefox
  • Safari

Mobile:

  • Chrome on Android
  • iOS

Copy link

coderabbitai bot commented Oct 16, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

Added a manual workflow_dispatch trigger with version and forcePush inputs and broadened conditions to accept either workflow_dispatch or workflow_call event input sources. Updated env resolution to read DOCS_VERSION and FORCE_PUSH from inputs or github.event.inputs, and adjusted several job/step if conditions for build vs publish and PR linking.

Changes

Cohort / File(s) Summary
CI/CD workflow
.github/workflows/publish-docs.yml
- Added workflow_dispatch trigger with version and forcePush inputs.
- Publish/PR-link steps: changed conditions to allow workflow_call event and use != true checks where appropriate (e.g., inputs.buildOnly != true).
- Updated env resolution to set DOCS_VERSION and FORCE_PUSH from either inputs or github.event.inputs, with fallbacks (including 'false').
- "Build docs, but do not publish" step condition updated to require workflow_call event.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Dev as Developer (manual)
    participant GH as GitHub Actions
    participant WF as publish-docs workflow
    participant Jobs as Jobs (build/publish/post-PR)

    Dev->>GH: Trigger workflow_dispatch (version, forcePush)
    GH->>WF: Start workflow (workflow_dispatch) or (workflow_call)
    WF->>Jobs: Evaluate job/step if-conditions
    alt buildOnly == true
        Jobs->>Jobs: Run build-only job (no publish)
    else buildOnly != true
        Jobs->>Jobs: Run build + publish
        alt linkToPR == true
            Jobs->>Jobs: Post docs link to PR
        end
    end
    Note right of Jobs: DOCS_VERSION and FORCE_PUSH resolved from inputs OR github.event.inputs (fallbacks)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly conveys that a manual trigger was added to the publish-docs workflow YAML, accurately reflecting the primary change in the PR.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

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

Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-3707/

Copy link

@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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/publish-docs.yml (1)

48-53: Make conditions and env compatible with both workflow_call and workflow_dispatch

  • In the “Publish docs” step, update to coalesce inputs and always run on manual dispatch:
    - if: inputs.buildOnly != true
    + if: inputs.buildOnly != true || github.event_name == 'workflow_dispatch'
      env:
    -   DOCS_VERSION: ${{ inputs.version }}
    -   FORCE_PUSH: ${{ inputs.forcePush }}
    +   DOCS_VERSION: ${{ inputs.version || github.event.inputs.version }}
    +   FORCE_PUSH: ${{ inputs.forcePush || github.event.inputs.forcePush || 'false' }}
      GH_TOKEN: ${{ secrets.PUBLISH_DOCS }}
  • Gate the “Build docs, but do not publish” step:
    - if: inputs.buildOnly
    + if: inputs.buildOnly && github.event_name != 'workflow_dispatch'
  • Gate the link-docs job:
    - if: inputs.buildOnly != true && inputs.linkToPR == true
    + if: (inputs.buildOnly != true && inputs.linkToPR == true) && github.event_name == 'workflow_call'
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5d6a54d and 7f24ea0.

📒 Files selected for processing (1)
  • .github/workflows/publish-docs.yml (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Docs / Publish Docs
  • GitHub Check: Test
  • GitHub Check: Build
🔇 Additional comments (1)
.github/workflows/publish-docs.yml (1)

64-64: Remove unnecessary event_name guard The link-docs job already requires inputs.linkToPR == true, and on a manual workflow_dispatch run inputs.linkToPR is undefined (or false), so the job never runs without adding github.event_name check.

Likely an incorrect or invalid review comment.

Comment on lines +24 to 35
workflow_dispatch:
inputs:
version:
description: 'The "name" of the version to be published. IMPORTANT: This only _names_ the published docs, it does not affect what is actually published. This workflow always builds and publishes the docs for whatever is the latest in the branch on which it is run.'
required: true
type: string
forcePush:
description: 'Pass `true` if git push should use `--force`.'
required: false
default: false
type: boolean

Copy link

@coderabbitai coderabbitai bot Oct 16, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Manual trigger added, but inputs context mismatch will break manual runs

This workflow still reads inputs.* (reusable-workflow context) for conditions and env. Under workflow_dispatch, values are under github.event.inputs. Without fallback, DOCS_VERSION/forcePush resolve empty and if conditions may error/misfire. Address by coalescing to github.event.inputs and guarding conditions by event_name.

🤖 Prompt for AI Agents
.github/workflows/publish-docs.yml lines 24-35: the manual trigger added exposes
inputs under github.event.inputs but the workflow still reads reusable-workflow
inputs.* causing DOCS_VERSION and forcePush to be empty or conditionals to
misfire; update the workflow to coalesce values from github.event.inputs when
github.event_name == 'workflow_dispatch' and otherwise fall back to inputs.*,
e.g. set env/vars using an expression that checks github.event_name ==
'workflow_dispatch' ? github.event.inputs.<name> : inputs.<name> (and provide
sensible defaults), and wrap any conditional checks with github.event_name
guards so conditions referencing github.event.inputs are only evaluated for
workflow_dispatch events.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@coderabbitai Has this been appropriately addressed in the fixup commit? (d47d87b)

Copy link

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Fetch the specific commit to see what changes were made
git show d47d87bc3e1e3ab83b5c76156f43bc310cee8488

Length of output: 1631


@adrianschmidt The environment variable coalescing has been correctly addressed! The expressions ${{ inputs.version || github.event.inputs.version }} and ${{ inputs.forcePush || github.event.inputs.forcePush || 'false' }} will properly resolve values from both workflow_call and workflow_dispatch contexts.

However, there's a critical issue with the conditional logic: The "Publish docs" step now has this condition:

if: github.event_name == 'workflow_call' && inputs.buildOnly == false

This condition will prevent the workflow from publishing docs when manually triggered via workflow_dispatch, because github.event_name will be 'workflow_dispatch', not 'workflow_call'. The step will simply be skipped.

Recommended fix:

- name: Publish docs
  if: github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_call' && inputs.buildOnly == false)
  env:
    DOCS_VERSION: ${{ inputs.version || github.event.inputs.version }}
    FORCE_PUSH: ${{ inputs.forcePush || github.event.inputs.forcePush || 'false' }}
    GH_TOKEN: ${{ secrets.PUBLISH_DOCS }}
  run: |
    if [ "$FORCE_PUSH" = "true" ]; then
      npm run docs:publish -- --v="$DOCS_VERSION" --forcePush
    else
      npm run docs:publish -- --v="$DOCS_VERSION"
    fi

This way:

  • Manual triggers (workflow_dispatch) will always publish
  • Reusable workflow calls (workflow_call) will only publish when buildOnly is false

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Fetch the specific commit to verify the fix
git show a8e92a2d5

Length of output: 945


@adrianschmidt Perfect! ✅ The fix in commit a8e92a2 correctly addresses the issue. The updated condition:

if: github.event_name == 'workflow_dispatch' || inputs.buildOnly == false

Now properly handles both scenarios:

  • Manual triggers (workflow_dispatch): Will always publish docs
  • Reusable workflow calls (workflow_call): Will publish only when buildOnly == false

The workflow is now fully functional for both manual and automated invocations! 🎉

ヽ(^‿^)ノ


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@adrianschmidt
Copy link
Contributor Author

@coderabbitai full review

Copy link

coderabbitai bot commented Oct 16, 2025

✅ Actions performed

Full review triggered.

@adrianschmidt adrianschmidt force-pushed the add-manual-trigger-to-publish-docs-workflow branch from a8e92a2 to 753d078 Compare October 16, 2025 16:55
@adrianschmidt adrianschmidt merged commit 15e17a1 into main Oct 16, 2025
12 checks passed
@adrianschmidt adrianschmidt deleted the add-manual-trigger-to-publish-docs-workflow branch October 16, 2025 16:59
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.

1 participant