Skip to content

Filter semantic-release commits by package path #561

Description

@romanlamsal

What

Both packages now extend semantic-release-monorepo (8.0.2). It limits analyzeCommits/generateNotes to commits that changed a file inside the package folder. The explicit tagFormat in each package.json overrides the plugin's default (@swr-data-lab/<pkg>-v${version}), so the existing components-v* / components-map-v* tags keep working.

Why

Each package runs its own semantic-release, but semantic-release analyzes every commit since the package's last tag, regardless of which files it touched. The workflow paths: filters only decide when a release job runs, not which commits count. That's how #555 published a bogus components@4.0.1 from a components-map fix.

Dry runs against a local bare clone (no GitHub/npm involved), with components-v4.0.1 removed to replay the bogus release:

Scenario Before After
components after #554 + #555 2 commits → 4.0.1 1 of 3 commits → no release
synthetic fix: in components/src only – components → 4.0.1, tag components-v4.0.1
synthetic feat: in components-map/src only – components-map → 1.1.0, tag components-map-v1.1.0

Live result on merge: both release workflows reported no release. components-map counted 1 of 2 commits since components-map-v1.0.0 (#555 filtered out).

Known trade-off

  • The plugin's last release was Feb 2024. It declares support for semantic-release 25, and the dry runs used 25.0.8.
  • Commits that only touch files outside a package folder (e.g. the root package-lock.json) no longer release that package.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions