googleapis / release-please-action

automated releases based on conventional commits
Apache License 2.0
1.61k stars 207 forks source link

After merging a release PR, a release is created but then a duplicate release PR is automatically opened #962

Open megancoyle opened 5 months ago

megancoyle commented 5 months ago

TL;DR

When using the release-please action, on triggering a release PR, if I merge in the release PR, a release will get created in the draft format, but a duplicate release PR will get opened

Here's an example of what the .release-please-manifest.json looks like:

{
  ".": "1.0.3"
}

Here's what the release-please-config.json looks like:

{
  "packages": {
    ".": {
      "release-type": "node",
      "draft": true,
      "include-component-in-tag": false
    }
  },
  "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}

Expected behavior

After merging in a release PR, I was expecting a draft release to get created, and no other PR get automatically opened.

Observed behavior

Instead, a duplicate release PR of the one just merged, was getting opened.

Action YAML

name: Run release-please

on:
  push:
    branches:
      - main

permissions:
  contents: write
  pull-requests: write

jobs:
  release-please:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Use latest release-please action
        uses: google-github-actions/release-please-action@v4
        with:
          token: ${{secrets.GITHUB_TOKEN}}
          config-file: release-please-config.json
          manifest-file: .release-please-manifest.json

Log output

No response

Additional information

No response

mirzak commented 4 months ago

I have the same problem.

d1onys1us commented 3 months ago

this is also giving us issues

vizio360 commented 2 months ago

having the same issue and I think I found the root cause. This happens when you have the draft:true flag set. This is because no git tag is created until the github release is manually published, so release please fails to find the new tag and creates a new PR with exactly the same changes.

I think release please action (or release please) should tag the repo regardless of the value of thedraft flag.

t-kelly commented 1 month ago

Tried a workaround using skip-github-release option and then generating a release in a followup step, but the same problem occurs. No tag is generated and things break

tsekiguchi commented 1 month ago

I'm also having this problem. Another issue is that with draft: true in my release-please-config.json, release please is grabbing every change since I added in release-please, causing incorrect changelogs and incorrect version bumps.