Class GitPushTrigger
- Namespace
- Invex.Atom.Workflows.Definition.Triggers
- Assembly
- Invex.Atom.Workflows.dll
Represents a workflow trigger that activates when code is pushed to a Git repository.
public sealed record GitPushTrigger : IWorkflowTrigger
- Inheritance
-
objectGitPushTrigger
- Implements
Examples
// Trigger on pushes to the main branch only
var mainTrigger = GitPushTrigger.ToMain;
// Trigger on pushes to any branch, excluding documentation changes
var featureTrigger = new GitPushTrigger
{
ExcludedPaths = ["docs/**", "*.md"]
};
Remarks
This trigger supports filtering by branches, file paths, and tags to control workflow execution.
When filter lists are empty, no filtering is applied for that category.
GitHub Actions does not allow a filter and its -ignore counterpart on the same event, so when both an
included and an excluded list are set, the GitHub workflow writes the exclusions as negated (!) patterns
after the inclusions.
Constructors
GitPushTrigger()
public GitPushTrigger()
Properties
ExcludedBranches
Gets or sets the list of branch patterns that should NOT trigger the workflow. Takes precedence over IncludedBranches.
public IReadOnlyList<string> ExcludedBranches { get; init; }
Property Value
- IReadOnlyList<string>
ExcludedPaths
Gets or sets the list of file path patterns that should NOT trigger the workflow. Takes precedence over IncludedPaths.
public IReadOnlyList<string> ExcludedPaths { get; init; }
Property Value
- IReadOnlyList<string>
ExcludedTags
Gets or sets the list of tag patterns that should NOT trigger the workflow. Takes precedence over IncludedTags.
public IReadOnlyList<string> ExcludedTags { get; init; }
Property Value
- IReadOnlyList<string>
IncludedBranches
Gets or sets the list of branch patterns that should trigger the workflow.
public IReadOnlyList<string> IncludedBranches { get; init; }
Property Value
- IReadOnlyList<string>
IncludedPaths
Gets or sets the list of file path patterns that should trigger the workflow.
public IReadOnlyList<string> IncludedPaths { get; init; }
Property Value
- IReadOnlyList<string>
IncludedTags
Gets or sets the list of tag patterns that should trigger the workflow.
public IReadOnlyList<string> IncludedTags { get; init; }
Property Value
- IReadOnlyList<string>