You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cm-file.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ An automation identifier is a composition of the CM file name and the automation
21
21
22
22
!!! tip
23
23
24
-
You can select (include or exclude) certain repositories per automation file using the [`triggers.include.repository`](./execution-model.md#trigger-configuration) and [`triggers.exclude.repository`](./execution-model.md#trigger-configuration)
24
+
You can select (include or exclude) certain repositories per automation file using the [`triggers.include.repository`](./execution-model.md#triggers-section) and [`triggers.exclude.repository`](./execution-model.md#triggers-section)
@@ -272,7 +272,7 @@ The `repo` context includes metadata related to the repo.
272
272
|`repo`| Map | Includes the info related to the current repo |
273
273
|`repo.age`| Integer | Number of days since first commit (of any user) |
274
274
|`repo.author_age`| Integer | number of days since first commit to this repo |
275
-
|`repo.blame`|[`GitBlame`](#gitblamep-structure)| The percentage of each user's lines in a file, the list includes all changed files in the branch. The `ratio` field sorts the list |
275
+
|`repo.blame`|[`GitBlame`](#gitblame-structure)| The percentage of each user's lines in a file, the list includes all changed files in the branch. The `ratio` field sorts the list |
276
276
|`repo.contributors`|[`Contributor`](#contributor-structure)| List of contributors in the repo |
277
277
|`repo.git_activity`|[`GitActivity`](#gitactivity-structure)| Per file and user, the number of lines changed every week for the last 52 weeks |
278
278
|`repo.languages`| Map | Lists the languages used in the specified repository. The returned object is a map of key-value pairs representing a language and the percentage of bytes in that language within the code. |
Copy file name to clipboardExpand all lines: docs/custom-github-app.md
+113-7Lines changed: 113 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,12 +37,11 @@ In LinearB, go to Settings -> Git -> click the `Connect gitStream` button next t
37
37
Keep this window open and complete the next steps in GitHub. Once you have the **App ID** and **Private Key** (.pem file), you can complete the connection in LinearB.
38
38
39
39
## 2. Create a New GitHub App
40
+
Any GitHub account on your self-hosted GitHub Server can own the app, but we recommend creating it under the organization account of the team who will maintain the gitStream installation.
40
41
41
-
Any GitHub account can own the app, but we recommend creating it under the organization account of the team who will maintain the gitStream installation.
42
-
43
-
- Log in to [GitHub](https://github.com/) and go to your organization account page (e.g., `https://github.com/<organization account name>`)
44
-
- Click on *Settings -> Developer Settings -> GitHub Apps -> New GitHub App* as shown below
45
-
- Or go directly to `https://github.com/organizations/<organization account name>/settings/apps/new`
42
+
- Log in to your GitHub Server and go to your organization account page (e.g., `https://<GITHUB_SERVER_URL>/<organization account name>`)
43
+
- Navigate to *Settings -> Developer Settings -> GitHub Apps -> New GitHub App* as shown below
44
+
- Or go directly to `https://<GITHUB_SERVER_URL>/settings/apps`
@@ -148,7 +147,9 @@ To complete the integration, fill in the App ID and Private Key in the LinearB s
148
147
149
148
## 10. Connect GitHub App to Your Repositories
150
149
151
-
Go to your organization settings in GitHub and in Third-party Access choose the GitHub Apps. You may need to choose the account to install the gitStream app on. Choose your org you used to create the GitHub app in the previous sections.
150
+
Go to your organization settings in GitHub and navigate to **Third-party Access** to manage GitHub Apps. Select the account where you want to install the gitStream app. Choose the organization you used to create the GitHub app in the previous steps.
151
+
152
+
Alternatively, you can go directly to the app settings at `https://<GITHUB_SERVER_URL>/settings/apps/<gitstream-app>/installations` and add the app to the relevant organizations.
@@ -162,4 +163,109 @@ Choose the repositories you want to connect.
162
163
163
164
## 11. Finish Setting Up gitStream
164
165
165
-
Follow the instructions to configure your repository using the [GitHub Instructions](github-installation.md)
166
+
You can now set up gitStream for a single repo, your GitHub organization or across all the organizations in the server. Select the tab below for the instructions you want.
167
+
=== "Single Repo"
168
+
**Single Repo Setup**
169
+
170
+
You must implement two main components for gitStream to function for a single GitHub repo. The first is a configuration file that defines the workflow automations to execute for the repo. The second is a GitHub actions configuration file that triggers gitStream when PRs are created or updated.
171
+
!!! example "Required Configurations"
172
+
**gitStream**
173
+
174
+
Create a `.cm/gitstream.cm` rules file in your repository's default branch (usually `master` or `main`). This file will contain a YAML configuration that determines the workflows that run on the repo, and you can name it anything you want as long as it ends in `.cm`
175
+
176
+
Here is an example of a gitStream configuration file you can use to setup some basic workflow automations.
177
+
178
+
```yaml+jinja
179
+
--8<-- "docs/downloads/gitstream.cm"
180
+
```
181
+
182
+
**GitHub Actions**
183
+
Once your gitStream configuration file is setup, you need a Github Actions configuration file to trigger gitStream automations. Create a `.github/workflows/gitstream.yml` file in your repository's default branch (usually `master` or `main`) and add the following configuration:
184
+
185
+
```yaml+jinja
186
+
--8<-- "docs/downloads/gitstream.yml"
187
+
```
188
+
189
+
!!! Success
190
+
When finished, you should have the following file structure in your repo.
191
+
192
+
```
193
+
.
194
+
├─ .cm/
195
+
│ └─ gitstream.cm
196
+
├─ .github/
197
+
│ └─ workflows/
198
+
│ └─ gitstream.yml
199
+
```
200
+
201
+
=== "GitHub Organization"
202
+
**GitHub Organization Setup**
203
+
204
+
Organization rules are ideal when you want to enforce consistent rules across every repo in your organization. You can define them by creating a special repository named `cm` in your GitHub organization where you can add automation files that will apply to **all** repositories within that organization.
205
+
206
+
!!! Tip "Prerequisite: Create a cm repo and enable gitStream."
207
+
Organization-wide automations need to be defined in a repo named "cm" inside your GitHub organization. Before continuing, you must create this repo and <a href="https://github.com/apps/gitstream-cm/installations/new" target="_blank">enable the gitStream app for it</a>.
208
+
209
+
!!! example "Required Configurations"
210
+
**gitStream**
211
+
212
+
Create a `gitstream.cm` rules file in the root directory of your cm repository's default branch (usually `master` or `main`). This file will contain a YAML configuration that determines the workflows that run on your organization's repos. You can name it anything you want as long as it ends in `.cm`
213
+
214
+
!!! info "Configuration files go in the repo's root directory."
215
+
Unlike the set up instructions for a single repo, your `.cm` files should be placed in the repository's root directory.
216
+
```yaml+jinja
217
+
--8<-- "docs/downloads/gitstream.cm"
218
+
```
219
+
**GitHub Actions**
220
+
221
+
Once your gitStream configuration file is set up, you will need to create a Github Actions configuration file to trigger gitStream automations. Create a `.github/workflows/gitstream.yml` file in your `cm` repository's default branch (usually `master` or `main`) and add the following configuration:
222
+
223
+
```yaml+jinja
224
+
--8<-- "docs/downloads/gitstream.yml"
225
+
```
226
+
227
+
!!! Success
228
+
Once finished, **all** PRs to your organization's repositories will be processed by the GitHub Action in this repo, and your `cm` repo should have a file directory that looks like this.
229
+
230
+
```
231
+
.
232
+
├─ gitstream.cm
233
+
├─ .github/
234
+
│ └─ workflows/
235
+
│ └─ gitstream.yml
236
+
=== "GitHub Multi Org"
237
+
**GitHub Multi Org Setup**
238
+
239
+
Multi-org rules are ideal when you want to enforce consistent rules across every repo across multiple organizations on your server. You can define them by creating a special repository named `cm` under the `cm` organization in your GitHub Server where you can add automation files that will apply to **all** repositories across all organizations.
240
+
241
+
!!! Tip "Prerequisite: Create a cm repo under the cm org and enable gitStream."
242
+
Multi-org automations need to be defined in a repo named `cm` inside the `cm` organization on your GitHub Server. Before continuing, you must create this repo and <a href="https://github.com/apps/gitstream-cm/installations/new" target="_blank">enable the gitStream app for it</a>.
243
+
244
+
!!! example "Required Configurations"
245
+
**gitStream**
246
+
247
+
Create a `gitstream.cm` rules file in the root directory of the `cm` repository's default branch (usually `master` or `main`). This file will contain a YAML configuration that determines the workflows that run on your server's repos. You can name it anything you want as long as it ends in `.cm`
248
+
249
+
!!! info "Configuration files go in the repo's root directory."
250
+
Unlike the setup instructions for a single repo, your `.cm` files should be placed in the repository's root directory.
251
+
```yaml+jinja
252
+
--8<-- "docs/downloads/gitstream.cm"
253
+
```
254
+
**GitHub Actions**
255
+
256
+
Once your gitStream configuration file is set up, you will need to create a Github Actions configuration file to trigger gitStream automations. Create a `.github/workflows/gitstream.yml` file in your `cm` repository's default branch (usually `master` or `main`) and add the following configuration:
257
+
258
+
```yaml+jinja
259
+
--8<-- "docs/downloads/gitstream.yml"
260
+
```
261
+
262
+
!!! Success
263
+
Once finished, **all** PRs to repositories across all organizations on your server will be processed by the GitHub Action in this repo, and your `cm` repo should have a file directory that looks like this.
0 commit comments