Skip to content

feat: add monorepo support with configurable paths and prerelease types#121

Closed
sharkey11 wants to merge 8 commits intomainfrom
feature/monorepo-support
Closed

feat: add monorepo support with configurable paths and prerelease types#121
sharkey11 wants to merge 8 commits intomainfrom
feature/monorepo-support

Conversation

@sharkey11
Copy link
Copy Markdown

Summary

Adds support for using turbo-module in monorepo setups where:

  • The package lives in a subdirectory (e.g., developer-platform/)
  • Multiple package.json files need version updates in sync
  • Custom prerelease types are needed (e.g., beta instead of canary)

New Inputs

Input Description Default
working-directory Subdirectory to operate in .
version-files JSON array of package.json paths to update ["package.json"]
publish-packages JSON array of packages to publish scans packages/*
prerelease-type Prerelease identifier (canary, beta, etc.) canary
base-branch Base branch for PRs main
max-changelog-commits Max commits to scan for changelog (0=unlimited) 100

Bug Fixes

  • Handle non-existent PRs gracefully (commits from other repos in a monorepo)
  • Add commit limit to prevent scanning thousands of commits
  • Filter changelog to only include commits touching the working directory

Backwards Compatible

Existing repos using turbo-module will continue to work with no changes - all new inputs have sensible defaults.

Test Plan

  • Tested with developer-platform-test-sdk-release.yml workflow in whop-monorepo
  • Verified release PRs are created with correct version bumps in all 3 package.json files
  • Verified changelog only includes commits touching developer-platform/
  • Verified changelog generation completes quickly with commit limit

- Add new action inputs: working-directory, version-files, publish-packages, prerelease-type, base-branch
- Support updating multiple package.json files when creating release PRs
- Support configurable prerelease types (e.g., beta instead of canary)
- Support monorepo subdirectories via working-directory input
- Backwards compatible: existing repos continue to work with defaults
Only include commits that touch files in the working directory
to prevent monorepo changelogs from including unrelated commits.
- Include version in PR title (e.g., "Release v0.0.6-beta.0")
- Create PRs as drafts by default
- Show commits in descending order (newest first)
- Update stale PR detection to use branch pattern
Comment on lines +22 to +27
export const versionFiles: string[] = JSON.parse(
getInput('version-files') || '["package.json"]',
);
export const publishPackages: string[] | undefined = getInput('publish-packages')
? JSON.parse(getInput('publish-packages'))
: undefined;

This comment was marked as outdated.

Titles now follow format: "[Prefix] Beta Release v0.0.6-beta.10"
- Prefix is optional and configurable via pr-title-prefix input
- Version is always included
- Prerelease type is capitalized (e.g., "Beta Release", "Canary Release")
Comment on lines +101 to +105
// Use the first version file as the source of truth for the version
const versionFilePath = withWorkingDir(versionFiles[0]);
const {
content: { version },
} = await getJsonFile<{ version: string }>('package.json');
console.log('version:', version, 'is canary:', isCanary(version));
} = await getJsonFile<{ version: string }>(versionFilePath as JSONFile);

This comment was marked as outdated.

Much more efficient for monorepos - instead of fetching all commits and
checking each one with a separate API call, use the GitHub API's built-in
path filter to only retrieve commits touching the working directory.
@sharkey11 sharkey11 closed this Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant