Skip to content

feat!: repackage as composite action (v0.2.0) - #1

Merged
therajanmaurya merged 1 commit into
mainfrom
feat/restructure-as-composite-action
Jun 2, 2026
Merged

feat!: repackage as composite action (v0.2.0)#1
therajanmaurya merged 1 commit into
mainfrom
feat/restructure-as-composite-action

Conversation

@therajanmaurya

@therajanmaurya therajanmaurya commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

BREAKING — repackages this repo from a reusable workflow into a composite action, aligning with the established naming pattern.

Why

mbl-actionhub-* repos are composite actions that mbl-actionhub's reusable workflows internally consume. Same shape as mbl-actionhub-bump-version + mbl-actionhub-resolve-version. v0.1.0 (released yesterday) accidentally shipped as a reusable workflow — inverting the layering.

Architecture after this PR + companion mbl-actionhub PR

Consumer workflow (12-line caller)
  ↓ uses: (reusable workflow)
mbl-actionhub/.github/workflows/sync-docs-to-wiki.yml@v1.8.0   ← companion PR (next)
  ↓ uses: (composite action)
MobileByteLabs/mbl-actionhub-docshub@v0.2.0                   ← THIS PR

Diff

File Change
action.yml NEW at root — composite action definition with docs-dir, sidebar-mode, token inputs
.github/workflows/sync-docs-to-wiki.yml DELETED — that role now belongs to mbl-actionhub
README.md Rewritten — 3-layer architecture diagram + recommended usage via mbl-actionhub
CHANGELOG.md 0.2.0 entry · marks 0.1.0 as deprecated
.github/workflows/ci.yml Adds composite-action-shape job — validates action.yml shape

Composite action surface

inputs:
  docs-dir:     { default: docs, required: false }
  sidebar-mode: { default: auto, required: false }  # auto | consumer-authored | none
  token:        { required: true }                  # GITHUB_TOKEN — composite actions
                                                    # can't read secrets directly

runs:
  using: composite
  steps:
    - run: python3 ${{ github.action_path }}/.github/scripts/rewrite-wiki-links.py …
    - run: smoke test on .wiki-build/
    - uses: Andrew-Chen-Wang/github-wiki-action@v4 (push to wiki)

github.action_path resolves to where the action was checked out → script path stays stable.

Token plumbing note

Composite actions can't read secrets.GITHUB_TOKEN directly. The caller (the mbl-actionhub reusable workflow) passes it via with: token: ${{ secrets.GITHUB_TOKEN }}. Documented in the README + the input's description:.

Self-test

The CI already validated this works:

$ python3 .github/scripts/rewrite-wiki-links.py tests/fixtures/sample-docs .wiki-build
  rewrote: sub-a/quick-start.md
  rewrote: sub-b/migration.md
  rewrote: Home.md
  rewrote: overview.md
  auto-generated: _Sidebar.md (6 pages)
  Done. 4 file(s) had links rewritten.

  ✓ sub-a-README.md  ✓ sub-b-README.md  ✓ overview.md  ✓ Home.md  ✓ _Sidebar.md

Coordinated rollout (3 more PRs after this merges + we tag v0.2.0)

  1. mbl-actionhub PR — add reusable workflow sync-docs-to-wiki.yml that uses: this composite. Tag v1.8.0.
  2. mbl-library-template-kmp PR — retarget caller from mbl-actionhub-docshub@v0.1.0mbl-actionhub@v1.8.0.
  3. kmp-product-flavors#114 — update PR's branch from mbl-actionhub-docshub@v0.1.0mbl-actionhub@v1.8.0.
  4. (KmpToolkit's development already references mbl-actionhub@v1.8.0 from PR #127 — becomes CORRECT once we ship v1.8.0. Will close the now-unnecessary fix PR #128.)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Breaking Changes

    • Project repackaged as a composite GitHub Action in version 0.2.0
    • Prior reusable workflow removed; use the new composite action directly or route through the action hub
  • New Features

    • Composite action with configurable inputs for docs directory, sidebar behavior, and GitHub token
    • Enhanced validation for wiki output generation
  • Documentation

    • README redesigned with direct usage examples and updated architecture guidance

Aligns with the established naming convention where mbl-actionhub-* repos
are composite actions that mbl-actionhub's reusable workflows internally
consume. Same shape as mbl-actionhub-bump-version + mbl-actionhub-
resolve-version. Consumer entry point stays unified through mbl-actionhub.

Architecture:

   Consumer's workflow
     ↓ (reusable workflow)
   mbl-actionhub/.github/workflows/sync-docs-to-wiki.yml@v1.8.0
     ↓ (composite action)
   MobileByteLabs/mbl-actionhub-docshub@v0.2.0  ← this repo

Changes
-------
* action.yml ADDED at root — composite action with docs-dir, sidebar-mode,
  token inputs. github.action_path resolves to the script location.
* .github/workflows/sync-docs-to-wiki.yml DELETED (the v0.1.0 reusable
  workflow) — that role now belongs to mbl-actionhub
* README.md rewritten to describe the composite-action arch + 3-layer flow
* CHANGELOG.md adds 0.2.0 entry marking 0.1.0 as deprecated (do NOT pin)
* CI updated to also validate action.yml shape (composite + required inputs)

Token plumbing
--------------
Composite actions can't read secrets.GITHUB_TOKEN directly — must be
passed explicitly via 'with: token:'. The mbl-actionhub reusable workflow
handles this for consumers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The project transitions from a reusable GitHub Actions workflow distributed in a separate repository to a composite GitHub Action defined at the repository root. The new action.yml bundles the docs-to-wiki rewriter with configurable inputs, integrates validation and publishing, and is tested in CI. The old reusable workflow is removed, and documentation is updated to guide users through the migration.

Changes

Composite Action Repackaging

Layer / File(s) Summary
Composite Action Definition
action.yml
Composite action metadata, three inputs (docs-dir, sidebar-mode, token), and three implementation steps: rewriter invocation with Python script, smoke test validation for .wiki-build/, and wiki publishing via Andrew-Chen-Wang/github-wiki-action@v4.
Composite Action Validation in CI
.github/workflows/ci.yml
New composite-action-shape job validates action.yml structure (composite type, required inputs, rewriter script presence); yaml-lint job now targets action.yml explicitly.
Fixture Testing and Smoke Test Updates
.github/workflows/ci.yml
Fixture smoke-test steps refactored: self-test comment renamed, Python syntax-check simplified, rewriter and slug-collision assertion steps restructured, and explanatory comment about out-of-tree links removed.
Reusable Workflow Retirement
.github/workflows/sync-docs-to-wiki.yml
Previous reusable workflow Sync docs to Wiki is entirely removed, consolidating its functionality into the root-level composite action.
Migration Documentation and Changelog
CHANGELOG.md, README.md
CHANGELOG documents breaking change (0.2.0), marks 0.1.0 deprecated, and recommends new composite action or mbl-actionhub reusable workflow. README restructured with architecture diagram, direct usage example, token passing guidance, and updated version/roadmap sections.

🎯 3 (Moderate) | ⏱️ ~25 minutes


🐰 A workflow once reusable, now composite and sleek,
Bundled in action.yml, with all that you seek—
Old .github patterns fade to the past,
While docs flow to Wiki, at last, at last!
Migrations complete, the new way is fast. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat!: repackage as composite action (v0.2.0)' directly and clearly summarizes the main change: converting the repository from a reusable workflow to a composite GitHub Action with version 0.2.0.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/restructure-as-composite-action

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.

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