Triggering On a Git Repository Change

JFrog Pipelines Documentation

Products
JFrog Pipelines
Content Type
User Guide
ft:sourceType
Paligo

A Git source code repository is represented by a GitRepo resource. The events that cause a GitRepo to trigger can be specified in the buildOn group of tags.

The most commonly used event for triggering a run of a pipeline is any commit to the Git repository. For this reason, the value of this tag defaults to true. So if that is the only event you want to trigger on, then you do not need to specify buildOn tags at all in the GitRepo resource.

Your GitRepo can be set to trigger on any of these buildOn events:

Tag

Default

Event

branchCreate

false

An existing branch is created

branchDelete

false

An existing branch is deleted

commit

true

A new commit to the Git repo

Note that when this is set as false, the resource is not updated and the resource version is not created.

pullRequestCreate

false

A new pull request made to the Git repo

pullRequestClose

false

A pull request to the Git repo is closed

releaseCreate

false

A new release request made to the Git repo

tagCreate

false

Creation of a new tag ref in the Git repo

Skipping a Git Repository Commit

If a specific commit should not trigger any runs for a GitRepo resource, include the text [skipRun] anywhere in the commit message and no runs will be triggered by that commit.

For example, to commit a change from the GitHub command line:

$ git commit -m "[skipRun] Fixed spelling errors in comments"
# Commits the tracked changes but does not trigger Pipelines.

The GitRepo resource will still be updated so that it will be current to the latest version of the repository for any Pipelines step that references that GitRepo resource.

The [skipRun] directive suppresses triggering only for a commit event. The GitRepo resource will still trigger on other buildOn events (such as a pull request) if those events are set to true.

Cancelling Previous Runs On a Git Repository Change

By default, when a GitRepo buildOn event (e.g., a commit) triggers a run for a pipeline that is already queued or is in-progress from a prior trigger, Pipelines will queue a new run of that pipeline. The new run executes after the prior run completes.

A GitRepo resource can be optionally configured to automatically cancel any queued or in-progress run that was triggered by the same GitRepo resource.

Your GitRepo can be set to cancel on any of thesecancelPendingRunsOnevents:

Tag

Default

Event

newCommit

false

commit: previous runs for the same branch are cancelled

tag: previous runs for the same tag name are cancelled

release: previous runs for the same release name are cancelled

pullRequestUpdate

false

previous runs for the same pull request number are cancelled

Runs will only be cancelled for change events of the same type. For example, a commit will only cancel runs triggered by previous commits to the same branch.