release-drafter / release-drafter

Drafts your next release notes as pull requests are merged into master.
https://github.com/marketplace/actions/release-drafter
ISC License
3.4k stars 327 forks source link

Example GitHub Action workflow for multiple branches #723

Open Benwick91 opened 3 years ago

Benwick91 commented 3 years ago

Hey,

I know these question comes very often, but is there a way and an example of a .yml file for the usage in Github Action and multiple branches? My use case: feature-branches develop staging for beta testing master for release

The action will be triggered when merging staging into master.

But this doesn't work in all use cases.

For example: feature --> PR for Release Notes --> develop --> staging --> master: PR is in Release Notes. Perfect

Another example

  1. feature1 --> PR for Release Notes --> develop --> staging But before Releasing:

  2. feature2 --> PR for Release Notes --> develop

  3. staging --> master: feature1 is included in Release Notes. Great.

  4. develop --> staging --> master: In the PR Commits from staging to Master the feature2 is involved but in the Release notes the feature2 is missing.

Is there a way to make it work so that PRs which are merged before a release to develop are included in the next release?

Thank you!

rizalgowandy commented 3 years ago

Any idea of how to do this thing?

mkurz commented 3 years ago

I am pretty sure you can solve this with the filter-by-commitish config. I wrote a little guide how to make things work, specially how to see and update the target_commitish value of a GitHub release (found at the end of my post): https://github.com/release-drafter/release-drafter/issues/656#issuecomment-806184887

ssbarnea commented 11 months ago

While I have being a happy user of release drafter for a good number of years, I was unable to find a way to make it work for projects that do keep maintenance branches.

If someone can point me to such a project I would be grateful.

jetersen commented 11 months ago

This does it somewhat nicely by simply extending release drafter with it's own functions: https://github.com/jenkins-infra/github-reusable-workflows/blob/main/.github/workflows/maven-cd.yml

By simply using a few lines of bash: https://github.com/jenkins-infra/jenkins-maven-cd-action/blob/master/run.sh#L15-L16