github-workflows-kt icon indicating copy to clipboard operation
github-workflows-kt copied to clipboard

[Bug] Replace enums by something that can get custom values

Open Vampire opened this issue 1 year ago • 2 comments

Action

The library is very flexible in the usage, so that you can in most places also give some custom value, in case things change since they were enumerated.

But at some places enums are used which can hardly be used with a custom value.

For example the Permission enum has no entry for generating attestations value and there is no convenient way to use it.

Expected

Enum-like values not being enums, but be extensible.

Actual

Enums are not extensible.

Library version

v2.3.0

Vampire avatar Aug 05 '24 08:08 Vampire

Yeah, we should probably have sealed classes with all enum-like values as objects, and a Custom(val value: String) class, like we do for action wrappers. WDYT?

krzema12 avatar Aug 05 '24 16:08 krzema12

Yes, something like that is what I had in mind. Just was in a rush and did not have the time to pull out an example, being confident you know what I mean. :-)

Vampire avatar Aug 05 '24 21:08 Vampire