-
Notifications
You must be signed in to change notification settings - Fork 3
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
Mark GitHub Release as draft if tag doesn't exist #16
Comments
Sorry, been busy with work stuff. Meant to answer you earlier on the PR comment.
This was actually our original behavior. The release was only marked as a draft, if it didn't exist when the upload started. That way all the artifact uploads could finish, before the release was "made public" We could either as you suggested, rename it for clarity, or, move it to an enum/boolean |
Sorry for being unclear. The So, regardless of what you set This issue is about keeping the release as a draft if the tag didn't exist (not release), although I suppose it may also be useful to also have the keep-as-draft-if-release-didn't-exist option too... |
I wonder if the best way to approach this would be a custom predicate? We could pass a context object to a
And use the return value in The default predicate could just be |
This sounds like a good compromise. To make it easier to implement, this could be tied to an Enum. That way you could pass in the enum, or a string, similar to ReleaseType, ModLoader etc |
An enum of default predicates? Not sure it'd make implementation easier, but it would make common use-cases simpler. enum GHDraftPredicate {
NEVER(ctx -> false),
ALWAYS(ctx -> true),
NEW_TAG(ctx -> !ctx.existingTag);
// etc
// Predicate field
@Getter
private Predicate<ReleaseContext> predicate;
// Example factory
static GHDraftPredicate valueOf(boolean val) {
return val ? ALWAYS : NEVER;
}
// Constructor, factories, etc omitted for clarity
} The |
While working on #15 I came to the conclusion that
createTag=false
anddraft=true
are kinda incompatible. Or at least unintuitive.I realised while working on MinecraftFreecam/Freecam#195 that it'd be useful to mark a release as a draft only when the tag doesn't exist yet.
I'm not sure the best API for this. Maybe some options would become
enums
, but withboolean
andString
overloaded setters?The text was updated successfully, but these errors were encountered: