Skip to content

Prevent redundant release-plz PRs by separating release and release-pr triggers#67

Merged
wheregmis merged 2 commits into
mainfrom
copilot/fix-release-plz-workflow
May 22, 2026
Merged

Prevent redundant release-plz PRs by separating release and release-pr triggers#67
wheregmis merged 2 commits into
mainfrom
copilot/fix-release-plz-workflow

Conversation

Copilot AI commented May 22, 2026

Copy link
Copy Markdown
Contributor

release-plz was running both release and release-pr on every push to main, which allowed a publish/tag to happen while still creating a follow-up reconciliation PR. This change separates those paths so publish does not race with PR generation.

  • Workflow trigger separation

    • Added workflow_dispatch to .github/workflows/release-plz.yml.
    • Kept push to main for automated release PR updates.
  • Job-level gating

    • release-plz-release now runs only for manual dispatch:
      if: github.event_name == 'workflow_dispatch'
    • release-plz-pr now runs only for pushes:
      if: github.event_name == 'push'
  • Resulting release flow

    • Push to main → create/update release PR only.
    • Manual dispatch → publish release only.

This keeps release-plz behavior deterministic and avoids stale/duplicate release PR creation after a version is already released.

Original prompt

Fix the release-plz workflow in wheregmis/dioxus-motion so it no longer creates redundant release PRs after a version has already been released.

Context:

  • PR chore(dioxus-motion): release v0.3.5 #66 (chore(dioxus-motion): release v0.3.5) was created by release-plz even though dioxus-motion-v0.3.5 had already been released and tagged on April 7, 2026.
  • The repository currently runs both release-plz release and release-plz release-pr on every push to main in .github/workflows/release-plz.yml.
  • This appears to let the release job publish a release while the release-pr job still opens a PR to reconcile changelog/version drift, resulting in duplicate or stale release PRs.

Relevant files already identified:

  • .github/workflows/release-plz.yml
  • release-plz.toml
  • CHANGELOG.md

Please:

  1. Update the release-plz GitHub Actions workflow to follow a sane release flow that prevents redundant release PR creation after a release is already published.
  2. Prefer the smallest, safest workflow-only change that fixes the automation behavior.
  3. Keep the intended release process clear and maintainable.
  4. Open a pull request with the workflow fix.

Notes:

  • The current workflow has one job running command: release and another running command: release-pr, both triggered by push to main.
  • A likely safe fix is to stop automatically running both commands on the same push event, for example by making one of them manual or otherwise separating triggers.
  • Avoid unrelated changes unless necessary for correctness.
  • Include a concise PR description explaining the root cause and the fix.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: even if its already released, release me is creating this PR. Identify the issue and lets fix this

Assistant: The issue is that your workflow always runs release-pr after release on every push to main, so after publishing v0.3.5, it immediately opens a PR to add the changelog/version commit that the release step itself did not merge back into main.

Concretely:

  • Cargo.toml on main is already at version = "0.3.5".
  • A GitHub release/tag for dioxus-motion-v0.3.5 was published on 2026-04-07.
  • But PR chore(dioxus-motion): release v0.3.5 #66 is still open and only changes CHANGELOG.md, adding another 0.3.5 entry.
  • Your workflow runs two separate jobs on every push to main: one with command: release, and another with command: release-pr. That means the second job can still see “release metadata/changelog drift” and create a PR even after the release was already published.

The likely root cause is: the release happened without the release PR being merged first, so the tag/release exists, but main never got the corresponding changelog update. Then release-pr keeps trying to reconcile that drift.

Evidence

release-plz.yml runs both jobs on every push to main:

name: Release-plz

on:
  push:
    branches:
      - main

jobs:

  # Release unpublished packages.
  release-plz-release:
    name: Release-plz release
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - &checkout
        name: Checkout repository
        uses: actions/checkout@v5
        with:
          fetch-depth: 0
          persist-credentials: false
      - &install-rust
        name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
      - name: Run release-plz
        uses: release-plz/action@v0.5
        with:
          command: release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

  # Create a PR with the new versions and changelog, preparing the next release.
  release-plz-pr:
    name: Release-plz PR
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
    concurrency:
      group: release-plz-${{ github.ref }}
      cancel-in-progress: false
    steps:
      - *checkout
      - *install-rust
      - name: Run release-plz
        uses: release-plz/action@v0.5
        with:
          command: release-pr
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

PR #66 only modifies CHANGELOG.md and adds a duplicate 0.3.5 section:

## [Unreleased]

## [0.3.5](https://github.com/wheregmis/dioxus-motion/compare/dioxus-motion-v0.3.4...dioxus-motion-v0.3.5) - 2026-04-07

### <!-- 3 -->Other

- release

## [0.1.2](https://github.com/wheregmis/dioxus-motion/compare/dioxus-motion-transitions-macro-v0.1.1...dioxus-motion-transitions-macro-v0.1.2) - 2026-04-07

And the PR patch shows it is tryin...

This pull request was created from Copilot chat.

Copilot AI changed the title [WIP] Fix release-plz workflow to prevent redundant release PRs Prevent redundant release-plz PRs by separating release and release-pr triggers May 22, 2026
Copilot AI requested a review from wheregmis May 22, 2026 18:36
@wheregmis wheregmis marked this pull request as ready for review May 22, 2026 18:43
@wheregmis wheregmis merged commit a80165a into main May 22, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants