Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 8ca90b9

Browse files
authored
Document how is evaluated (#16077)
1 parent 72baa71 commit 8ca90b9

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

doc/campaigns/references/campaign_spec_yaml_reference.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ on:
7575

7676
A specific repository (and branch) that is added to the list of repositories that the campaign will be run on.
7777

78-
A `branch` attribute specifies the branch on the repository to propose changes to. If unset, the repository's default branch is used.
78+
A `branch` attribute specifies the branch on the repository to propose changes to. If unset, the repository's default branch is used. If set, it overwrites earlier values to be used for the repository's branch.
7979

8080
### Examples
8181

@@ -91,6 +91,27 @@ on:
9191
- repository: github.com/sourcegraph/src-cli
9292
```
9393

94+
In the following example, the `repositoriesMatchingQuery` returns both repositories with their default branch, but the `3.23` branch is used for `github.com/sourcegraph/sourcegraph`, since it is more specific:
95+
96+
```yaml
97+
on:
98+
- repositoriesMatchingQuery: repo:sourcegraph\/(sourcegraph|src-cli)$
99+
- repository: github.com/sourcegraph/sourcegraph
100+
branch: 3.23
101+
```
102+
103+
In this example, `3.19-beta` branch is used, since it was named last:
104+
105+
```yaml
106+
on:
107+
- repositoriesMatchingQuery: repo:sourcegraph\/(sourcegraph|src-cli)$
108+
- repository: github.com/sourcegraph/sourcegraph
109+
branch: 3.23
110+
- repository: github.com/sourcegraph/sourcegraph
111+
branch: 3.19-beta
112+
```
113+
114+
94115
## [`steps`](#steps)
95116

96117
The sequence of commands to run (for each repository branch matched in the `on` property) to produce the campaign's changes.

0 commit comments

Comments
 (0)