googleapis / googleapis/release-please-action

Pubspec file is getting updated with invalid version tag.

Open
#843 0 comments 0 reactions 1 assignee Claimed by @chingor13 View on GitHub
priority: p3 type: bug
Dominant language
TypeScript
Stars
2.5k
Forks
327
PR merge metrics
No merged PRs in 30d

Description

### TL;DR

If a release pull request is made to increment the minor version, and there exist multiple pre-releases following to it, the pubspec file within the release pull request will have an invalid version, as shown in the images below.

Screenshot 2023-10-25 at 8 27 05 AM

Screenshot 2023-10-25 at 8 16 23 AM

### Expected behavior

The intended functionality is that if the release pull request is for version `v2.1.0`, the pubspec file should also be updated to version `v2.1.0` without being affected by any `+-rc` tags, even if there are multiple pre-release following the release pr.

### Observed behavior

If a release pull request is created to increase the minor version, and there are multiple subsequent pre-releases, the pubspec file within the release pull request will have a version that combines the new release version with the current+1 pre-release version. For instance, if the release pull request is for version `v2.1.0` and the current pre-release is `v2.0.1-rc.2`, the pubspec file version in the release pull request will be `v2.1.0+-rc.3`, which is an invalid version.

### Action YAML

```yaml
name: Release Please
description: >
Release Please automates CHANGELOG generation, the creation of GitHub releases, and version bumps for your projects.
inputs:
github-token:
required: true
description: GitHub token for creating the release PR
default-branch:
required: false
description: Branch to open pull release PR against (detected by default)
runs:
using: composite
steps:
- id: release
uses: google-github-actions/release-please-action@v3
with:
token: ${{ inputs.github-token }}
command: manifest
default-branch: ${{ inputs.default-branch }}
```

### Log output

_No response_

### Additional information

release-please-config.json
```json
{
"separate-pull-requests": true,
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"release-type": "dart",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"extra-files": ["pubspec.yaml"],
"draft": false,
"prerelease": false,
"include-component-in-tag": false,
"component": ""
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
```

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.