googleapis / googleapis/release-please

Manifest releaser with Lerna not updating root package-lock.json file

Open
#1,101 1 comment 5 reactions 0 assignees View on GitHub
type: feature request
Dominant language
TypeScript
Stars
7.5k
Forks
588
Avg merge
12h 16m
Merged PRs (30d)
7

Description

**Is your feature request related to a problem? Please describe.**

I would like to use Release Please in conjunction with a Lerna monorepo to release Node.js libraries.
So I use the `manifest` command with the `node-workspace` plugin.
The version bumping works well. I also see that the Node releaser only update `package-lock.json` files for each sub-packages.
But when using Lerna with a NPM workspaces configuration, the `package-lock.json` file is located in the root folder and it is not updated after version bumping.

**Describe the solution you'd like**

I think that Release Please need to have dedicated releaser for Lerna or NPM/Yarn workspaces.

**Describe alternatives you've considered**

We can manually update the `package-lock.json` file with this command:
`npm install --no-audit --no-fund --ignore-scripts --package-lock-only`
This library need to let the user to do some actions before commiting and creating/updating the pull request.

Notes: I use release-please in a GitHub action with https://github.com/google-github-actions/release-please-action

**Workarounds**

I found a workaround, I need to run a custom job after release-please for updating the pull request with `code-suggester`.

```yaml
name: Release Please

on:
push:
branches: [master]

jobs:
release-please:
name: Release Please
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release-please.outputs.releases_created }}
steps:
- name: Running Release Please
id: release-please
uses: GoogleCloudPlatform/release-please-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
command: manifest
config-file: .github/release-please-config.json
manifest-file: .github/release-please-manifest.json

update-pull-request:
name: Update pull request
runs-on: ubuntu-latest
needs: release-please
if: needs.release-please.outputs.releases_created != 'true'
steps:
- name: Fetching the repository
uses: actions/checkout@v2
with:
ref: release-please/branches/master
fetch-depth: 2

- name: Setting up Node.js 16
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: Updating package-lock.json file
run: npm install --no-audit --no-fund --ignore-scripts --package-lock-only

- name: Merging changes with last commit
run: |
git reset --soft HEAD~1
git add .

- name: Updating pull request
uses: googleapis/code-suggester@v2
env:
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
command: pr
upstream_owner: ${{ github.repository_owner }}
upstream_repo: ${{ github.event.repository.name }}
description: "release master"
title: "chore: release master"
message: "chore: release master"
branch: release-please/branches/master
primary: master
force: true
fork: false
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.