googleapis / release-please-action

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

How to use release-please-action to perform hotfix #930

Open jfoo1984 opened 6 months ago

jfoo1984 commented 6 months ago

TL;DR

I'm wondering if it is possible to use this action to make hotfixes. Essentially, this would involve cherry picking a fix PR commit merged to the main branch onto specific release tags (the release tags that are deployed to our staging and production environments).

Detailed design

No response

Additional information

No response

raja-anbazhagan commented 3 months ago

Is this even possible?

axel-havukangas-tt commented 3 weeks ago

According to the documentation, you can use different target branches for different releases. So in your github action you could have something like

on:
  push:
    branches:
      - main
      - 'hotfix/**'
name: release-please
jobs:
  release-please:
    runs-on: ubuntu-latest
    steps:
      - uses: googleapis/release-please-action@v4
        with:
          release-type: node
          # The short ref name of the branch or tag that triggered
          #  the workflow run. For example, `main` or `hotfix/urgent-bugfix`
          target-branch: ${{ github.ref_name }}

this should then create separate release PRs for each branch that triggers the action.