Semantic Release Not Handling Package.json Or Files One Level Up Correctly

Open
#485 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
git, javascript
Domain
release

Research direction

Start by reproducing the reported @semantic-release/git configuration with CHANGELOG.md, local package.json, and package.json paths using ../. Inspect the plugin's asset path handling and verify that files one level above the releasing library are included in the release commit, while existing local assets continue to work.

Written by the indexing model from the issue text.

Description

Current behavior

When using the following configuration, the @semantic-release/git plugin appears to push the changelog and any files located in the same or subdirectory of the releasing library to the target branch. However, it does not push the package.json files or any other files that are one level up (../) from the released library.

const commitUpdatedAssets = [
  '@semantic-release/git',
  {
   // Notice we use a regex and relative path and both fail but CHANGELOG.md works
    assets: ['../**/*/package.json', `${disRoot}/package.json`, `../beam/package.json`  'CHANGELOG.md'],
    message:
      'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
  },
];

const plugIns = [
  commitAnalyzer,
  releaseNotesGenerator,
  updatePackagesThatDepOnMeVersion,
  changelog,
  npm,
  github,
  commitUpdatedAssets,
];

Expected behavior

The @semantic-release/git plugin should respect other package.json files or files that are not in the released library and are one level up (../). These files should be pushed to the repository along with the files that are local to the library (./).

Dominant language
JavaScript
Stars
339
Forks
75
Avg merge
5h 15m
Merged PRs (30d)
6

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from semantic-release/git

All issues in semantic-release/git

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.