Interface IWorkflowWriter
Defines a contract for writers that can generate and validate platform-specific workflow files.
public interface IWorkflowWriter
Remarks
This interface is part of a strategy pattern where different writers handle different CI/CD platforms. Implementations are typically registered as singletons and are expected to be thread-safe.
Properties
WorkflowType
Gets the type of workflow that this writer can handle (e.g., GitHub Actions, Azure DevOps).
Type WorkflowType { get; }
Property Value
- Type
Methods
CheckForOutdatedWorkflow(WorkflowModel, CancellationToken)
Checks if the existing workflow file is outdated and needs to be regenerated.
Task<bool> CheckForOutdatedWorkflow(WorkflowModel workflow, CancellationToken cancellationToken = default)
Parameters
workflowWorkflowModelThe workflow model to compare against the existing file.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<bool>
A task that resolves to
trueif the workflow file is missing or outdated; otherwise,false.
Generate(WorkflowModel, CancellationToken)
Generates a workflow file from the specified workflow model.
Task Generate(WorkflowModel workflow, CancellationToken cancellationToken = default)
Parameters
workflowWorkflowModelThe workflow model to generate.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task
A task representing the asynchronous generation operation.