slawekjaranowski opened a new issue, #393:
URL: https://github.com/apache/maven-clean-plugin/issues/393
## Problem
After renaming branches (`maven-xxx-plugin-3.x` → `master`, `master` →
`maven-xxx-plugin-4.x`), Release Drafter produces wrong drafts.
The shared configuration in `apache/maven-gh-actions-shared` sets:
```yaml
filter-by-commitish: true
```
So Release Drafter only takes into account the published releases whose
`target_commitish` matches the branch it runs on. After the rename, the
existing releases still point to the old branch names:
- 4.x releases have `target_commitish: master`, which is now the 3.x line
- 3.x releases have `target_commitish: refs/heads/maven-xxx-plugin-3.x`, a
branch that no longer exists
## Symptoms
In this repository:
- The draft on `master` (3.5.1) uses `4.0.0-beta-3` as the previous release,
so the notes include changes from the 4.x line (e.g. "Build with Maven 4",
MCLEAN-106, MCLEAN-118, MCLEAN-122).
- The draft on `maven-clean-plugin-4.x` (4.0.0-beta-4) says *"Release
Drafter could not find a previous published release"* and "No changes".
## How to fix
1. List the releases and their `target_commitish`:
```bash
gh api repos/apache/<repo>/releases --paginate \
-q '.[] | [.id, .tag_name, .draft, .target_commitish] | @tsv'
```
2. Update the published releases so they point to the new branch names:
- 4.x releases → `maven-xxx-plugin-4.x`
- 3.x releases made from the old `maven-xxx-plugin-3.x` branch → `master`
- Older releases made when `master` was the 3.x line need no change.
```bash
gh api -X PATCH repos/apache/<repo>/releases/<id> -f
target_commitish=<new-branch>
```
The tags already exist, so only the release metadata changes and the tags
stay where they are.
3. Run the Release Drafter workflow manually (`workflow_dispatch`) on both
branches to regenerate the drafts:
```bash
gh workflow run release-drafter.yml -R apache/<repo> --ref master
gh workflow run release-drafter.yml -R apache/<repo> --ref
maven-xxx-plugin-4.x
```
4. Check that both drafts now compare against the correct previous release.
## Changes needed in this repository
| Release | current `target_commitish` | new |
|---|---|---|
| 4.0.0-beta-3 | `master` | `maven-clean-plugin-4.x` |
| 4.0.0-beta-2 | `refs/heads/master` | `maven-clean-plugin-4.x` |
| 4.0.0-beta-1 | `master` | `maven-clean-plugin-4.x` |
| 3.5.0 | `refs/heads/maven-clean-plugin-3.x` | `master` |
| 3.4.1 | `refs/heads/maven-clean-plugin-3.x` | `master` |
| 3.4.0 | `refs/heads/maven-clean-plugin-3.x` | `master` |
## Other repositories
The same issue is expected in every other Maven repository where the default
branch was swapped in the same way. Check their releases' `target_commitish`
with the steps above and fix them if needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]