Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add generate-release-notes parameter #173

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fernandrone
Copy link

Add a parameter that sets the "generate_release_notes" boolean option of the API call. When set, it autogenerates a release note.

The parameter defaults to "false" so this is not a breaking change. See documentation on https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#create-a-release

Add a parameter that sets the "generate_release_notes" boolean option of
the API call. When set, it autogenerates a release note.
@fernandrone fernandrone marked this pull request as ready for review April 9, 2024 22:27
@fernandrone
Copy link
Author

FWIW I've tested this on my organization's internal repositories and it works as expected 👍🏻

@jvalecillos
Copy link

This should be part of this plugin, there's no reason for having the setting parameter but not having the config option for it.

@fernandrone
Copy link
Author

FWIW I've found this version which supports it https://codeberg.org/woodpecker-plugins/release/src/branch/main/docs.md (and is likely to be compatible with drone, haven't tested it yet).

@jvalecillos
Copy link

FWIW I've found this version which supports it https://codeberg.org/woodpecker-plugins/release/src/branch/main/docs.md (and is likely to be compatible with drone, haven't tested it yet).

@fernandrone Could you please elaborate?

I tested it, and it actually doesn't work because, in that plugin, the setting is not set in the metadata. Therefore, it is never passed and is assumed to be false when calling the GitHub API. Not to mention, it is not a drop-in replacement because the other plugin requires some configuration shenanigans.

https://codeberg.org/woodpecker-plugins/release/src/branch/main/impl.go#L119-L130

	m := &forge.Metadata{
		Owner:      p.Metadata.Repository.Owner,
		Repo:       p.Metadata.Repository.Name,
		Tag:        strings.TrimPrefix(p.Metadata.Commit.Ref, "refs/tags/"),
		Target:     p.Settings.Target,
		Draft:      p.Settings.Draft,
		Prerelease: p.Settings.PreRelease,
		FileExists: p.Settings.FileExists,
		Title:      p.Settings.Title,
		Note:       p.Settings.Note,
		Overwrite:  p.Settings.Overwrite,
	}

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