Skip to content

Improve WorkflowRun customization #13

@ianlewis

Description

@ianlewis

Consider adding utility functions on the WorkflowRun to customize fields. This will allow generators that use the API to set their own build type and fields easier.

Some earlier suggestions from @laurentsimon

Just a last-minute thought. We could also have WithXXX() functions, which may be simple too:

r := slsa.NewWorkflowRun(subjects, githubContext)
       .WithBuildType("some_string")
       .WithBuildConfig(some_struct)
func (self * WorkflowRun) WithBuildConfig(arg interface{}) *WorkflowRun{
  self.BuildConfig = arg
  return self
}

Can do that in a follow-up PR if we want

Maybe AddMaterial() and AddEnvironment() would work. Let's just file an issue for later discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:libraryIssue with the base reusable Go librarytype:featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions