Skip to content

Commit 340d1a4

Browse files
committed
Give an example of {checkout,push}.branch
As a YAML example, this also shows the YAML/JSON field names. Since field names are different in the Go types, it can be confusing. Signed-off-by: Michael Bridgen <[email protected]>
1 parent 076758a commit 340d1a4

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

docs/spec/v1alpha1/imageupdateautomations.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,28 @@ type PushSpec struct {
277277
}
278278
```
279279

280-
If `push` is not present, commits are made on the same branch as `.checkout.branch` and pushed to
281-
the same branch at the origin.
280+
If `push` is not present, commits are made on the same branch as `.spec.checkout.branch` and pushed
281+
to the same branch at the origin.
282282

283-
When `push` is present, the `push.branch` field specifies a branch to push to at the origin. The
284-
branch will be created locally if it does not already exist, starting from `.checkout.branch`. If it
285-
does already exist, updates will be calculated on top of any commits already on the branch.
283+
When `push` is present, the `.spec.push.branch` field specifies a branch to push to at the
284+
origin. The branch will be created locally if it does not already exist, starting from
285+
`.spec.checkout.branch`. If it does already exist, updates will be calculated on top of any commits
286+
already on the branch.
287+
288+
In the following snippet, updates will be pushed as commits to the branch `auto`, and when that
289+
branch does not exist at the origin, it will be created locally starting from the branch `main` and
290+
pushed:
291+
292+
```yaml
293+
spec:
294+
# ... commit, update, etc.
295+
checkout:
296+
gitRepositoryRef:
297+
name: app-repo
298+
branch: main
299+
push:
300+
branch: auto
301+
```
286302
287303
## Status
288304

0 commit comments

Comments
 (0)