googleapis / googleapis/release-please-action
release-as input is silently ignored in manifest mode
- Dominant language
- TypeScript
- Stars
- 2.5k
- Forks
- 327
- PR merge metrics
- No merged PRs in 30d
Description
### Summary
The `release-as` input is silently ignored whenever the action runs in manifest mode (i.e. `release-type` is not set and a `release-please-config.json` is used). The version is neither forced nor reported as unsupported — release-please computes its own bump, so the workflow looks green while producing the wrong version.
### Environment details
- `googleapis/release-please-action@v5` (same code on `main`)
- Running release-please version: 17.6.0
- Config: `release-please-config.json` (`release-type: go`, `include-v-in-tag: true`) + `.release-please-manifest.json`
### Steps to reproduce
1. Repo with `release-please-config.json` / `.release-please-manifest.json`, current version `2.75.2-dk.1`.
2. Workflow step:
```yaml
- uses: googleapis/release-please-action@v5
with:
target-branch: main
token: ${{ secrets.TOKEN }}
release-as: 2.75.2-dk.2
```
3. Land a `fix:` commit on `main`.
### Expected
Release PR for `2.75.2-dk.2`.
### Actual
Release PR for `2.75.3-dk.1` — release-please's own patch bump. The run log shows the input arrived:
```
Run googleapis/release-please-action@v5
with:
target-branch: main
release-as: 2.75.2-dk.2
Running release-please version: 17.6.0
...
✔ Building candidate release pull request for path: .
✔ Considering: 4 commits
```
…and no `Setting version for . from release-as configuration` line.
### Cause
`src/index.ts`, `loadOrBuildManifest()` forwards `releaseAs` only on the `Manifest.fromConfig` branch, which is taken when the `release-type` input is set:
```ts
if (inputs.releaseType) {
return Manifest.fromConfig(github, ..., {
releaseType: inputs.releaseType,
...
releaseAs: inputs.releaseAs, // honored here
}, ...);
}
...
return Manifest.fromManifest(
github,
github.repository.defaultBranch,
inputs.configFile,
inputs.manifestFile,
manifestOverrides, // releaseAs never passed
);
```
The library does support the override in manifest mode: `Manifest.fromManifest()` takes `releaseAs` as its 6th parameter (`manifest.ts`), and `parseConfig()` writes it into `repositoryConfig[path].releaseAs` for every path. The CLI passes it (`bin/release-please.ts`, `release-pr` handler), which is why `npx release-please release-pr --release-as=…` works against the very same config.
### Suggested fix
Pass `inputs.releaseAs` (and `pathsToRelease`, if applicable) to `Manifest.fromManifest`:
```ts
return Manifest.fromManifest(
github,
github.repository.defaultBranch,
inputs.configFile,
inputs.manifestFile,
manifestOverrides,
undefined,
inputs.releaseAs,
);
```
Failing that, the action should error out when `release-as` is set but cannot be applied, instead of releasing a different version than requested.
Same class of bug as #1088 (input dropped on the path that does not consume it), mirrored: there `manifest-file` is ignored on the `fromConfig` path, here `release-as` is ignored on the `fromManifest` path.
### Workaround
Replace the action with the CLI:
```yaml
- run: |
npx --yes release-please@17.6.0 release-pr \
--repo-url="${{ github.repository }}" --target-branch="${{ github.ref_name }}" \
--token="$GITHUB_TOKEN" --release-as=2.75.2-dk.2
```
Contributor guide
Assessment
This issue has not been assessed yet.