Skip to content

Commit 756c77a

Browse files
committed
mandates ref when branch is not master
1 parent 1ef9bb2 commit 756c77a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

modules/builds-source-code.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ ifndef::openshift-online[]
2323
dockerfile: "FROM openshift/ruby-22-centos7\nUSER example" <3>
2424
endif::[]
2525
----
26-
<1> The `git` field contains the URI to the remote Git repository of the source code. Optionally, specify the `ref` field to check out a specific Git reference. A valid `ref` can be a SHA1 tag or a branch name.
26+
<1> The `git` field contains the Uniform Resource Identifier (URI) to the remote Git repository of the source code. You must specify the value of the `ref` field to check out a specific Git reference. A valid `ref` can be a SHA1 tag or a branch name. The default value of the `ref` field is `master`.
2727
<2> The `contextDir` field allows you to override the default location inside the source code repository where the build looks for the application source code. If your application exists inside a sub-directory, you can override the default location (the root folder) using this field.
2828
ifndef::openshift-online[]
2929
<3> If the optional `dockerfile` field is provided, it should be a string containing a Dockerfile that overwrites any Dockerfile that may exist in the source repository.
3030
endif::[]
3131

3232
If the `ref` field denotes a pull request, the system uses a `git fetch` operation and then checkout `FETCH_HEAD`.
3333

34-
When no `ref` value is provided, {product-title} performs a shallow clone (`--depth=1`). In this case, only the files associated with the most recent commit on the default branch (typically `master`) are downloaded. This results in repositories downloading faster, but without the full commit history. To perform a full `git clone` of the default branch of a specified repository, set `ref` to the name of the default branch (for example `master`).
34+
When no `ref` value is provided, {product-title} performs a shallow clone (`--depth=1`). In this case, only the files associated with the most recent commit on the default branch (typically `master`) are downloaded. This results in repositories downloading faster, but without the full commit history. To perform a full `git clone` of the default branch of a specified repository, set `ref` to the name of the default branch (for example `main`).
3535

3636

3737
[WARNING]

modules/builds-using-github-webhooks.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ $ curl -H "X-GitHub-Event: push" -H "Content-Type: application/json" -k -X POST
8484
The `-k` argument is only necessary if your API server does not have a properly
8585
signed certificate.
8686

87+
[NOTE]
88+
====
89+
The build will only be triggered if the `ref` value from GitHub webhook event matches the `ref` value specified in the `source.git` field of the `BuildConfig` resource.
90+
====
91+
8792
[role="_additional-resources"]
8893
.Additional resources
8994

0 commit comments

Comments
 (0)