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: README.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,6 +115,26 @@ However, when named `otterdog.jsonnet` or `otterdog.json`, the cli tool will aut
115
115
> In this example the `plain` provider is being used to access credentials to avoid setting up a `real` credential provider (see below) for a quick setup.
116
116
> However, the `plain` provider should *NOT* be used for anything else to avoid leakage of data in case the `otterdog.json` file is shared with other users.
117
117
118
+
### Environment Variables
119
+
120
+
#### OTTERDOG_CONFIG_ROOT
121
+
122
+
The `OTTERDOG_CONFIG_ROOT` environment variable allows you to specify a custom root directory for Otterdog configuration files and organization data. E.g: https://github.com/EclipseFdn/otterdog-configs
123
+
124
+
When set, Otterdog will:
125
+
- Search for configuration files (`otterdog.jsonnet` or `otterdog.json`) in this directory
126
+
- Use this directory as the base path for the `config_dir` (default: `orgs/`) containing organization configurations
127
+
128
+
**Usage:**
129
+
130
+
```bash
131
+
# Set the configuration root directory
132
+
export OTTERDOG_CONFIG_ROOT=/path/to/config
133
+
134
+
# Run otterdog commands - will automatically use the specified directory
135
+
otterdog fetch-config eclipse-csi
136
+
otterdog apply eclipse-csi
137
+
```
118
138
### Credentials
119
139
120
140
Otterdog needs certain credentials to access information from an organization and its repositories on GitHub:
The environment variables need to be set in the system where otterdog is executed.
188
+
They can also be set in a `.env` file in the current working directory, which will be automatically loaded by otterdog.
189
+
190
+
If you want to keep the same environment variable pattern across organizations, you can set defaults and use placeholders in the `defaults.env` section. The env provider normalizes placeholder values by converting them to uppercase and replacing spaces and hyphens with underscores. You can use `{org_name}` and `{github_id}`.
191
+
192
+
```json
193
+
{
194
+
"defaults": {
195
+
"credentials": {
196
+
"provider": "env"
197
+
},
198
+
"env": {
199
+
"api_token": "OTTER_{org_name}_API_TOKEN",
200
+
"username": "OTTER_{org_name}_USERNAME",
201
+
"password": "OTTER_{github_id}_PASSWORD",
202
+
"twofa_seed": "OTTER_{github_id}_TOTP_SEED"
203
+
}
204
+
}
205
+
}
206
+
```
207
+
208
+
Hint: You can combine this provider with GitHub Actions secrets to securely store the credentials in a GitHub repository and use them in a GitHub action that runs otterdog:
|_enabled_| boolean | If GitHub actions are enabled for this repository ||
64
-
|_allowed_actions_| string | Defines which type of GitHub Actions are permitted to run |`all`, `local_only` or `selected`|
65
-
|_allow_github_owned_actions_| boolean | If GitHub owned actions are permitted to run | Only taken into account when `allowed_actions` is set to `selected`|
66
-
|_allow_verified_creator_actions_| boolean | If GitHub Actions from verified creators are permitted to run | Only taken into account when `allowed_actions` is set to `selected`|
67
-
|_allow_action_patterns_| list[string]| A list of action patterns permitted to run | Only taken into account when `allowed_actions` is set to `selected`|
68
-
|_default_workflow_permissions_| string | The default workflow permissions granted to the GITHUB_TOKEN |`read` or `write`|
69
-
|_actions_can_approve_pull_request_reviews_| boolean | If actions can approve and merge pull requests ||
|_enabled_| boolean | If GitHub actions are enabled for this repository ||
64
+
|_allowed_actions_| string | Defines which type of GitHub Actions are permitted to run |`all`, `local_only` or `selected`|
65
+
|_allow_github_owned_actions_| boolean | If GitHub owned actions are permitted to run | Only taken into account when `allowed_actions` is set to `selected`|
66
+
|_allow_verified_creator_actions_| boolean | If GitHub Actions from verified creators are permitted to run | Only taken into account when `allowed_actions` is set to `selected`|
67
+
|_allow_action_patterns_| list[string]| A list of action patterns permitted to run | Only taken into account when `allowed_actions` is set to `selected`|
68
+
|_default_workflow_permissions_| string | The default workflow permissions granted to the GITHUB_TOKEN |`read` or `write`|
69
+
|_actions_can_approve_pull_request_reviews_| boolean | If actions can approve and merge pull requests ||
70
+
|_fork_pr_approval_policy_| string | Controls when fork PR workflows require approval from a maintainer |`first_time_contributors_new_to_github`, `first_time_contributors` or `all_external_contributors`|
|_enabled_repositories_| string | Defines which repositories are permitted to use GitHub Actions |`all`, `none` or `selected`|
47
-
|_selected_repositories_| list[string]| The list of repositories that are permitted to use GitHub Actions | Only taken into account when `enabled_repositories` is set to `selected`|
48
-
|_allowed_actions_| string | Defines which type of GitHub Actions are permitted to run |`all`, `local_only` or `selected`|
49
-
|_allow_github_owned_actions_| boolean | If GitHub owned actions are permitted to run | Only taken into account when `allowed_actions` is set to `selected`|
50
-
|_allow_verified_creator_actions_| boolean | If GitHub Actions from verified creators are permitted to run | Only taken into account when `allowed_actions` is set to `selected`|
51
-
|_allow_action_patterns_| list[string]| A list of action patterns permitted to run | Only taken into account when `allowed_actions` is set to `selected`|
52
-
|_default_workflow_permissions_| string | The default workflow permissions granted to the GITHUB_TOKEN |`read` or `write`|
53
-
|_actions_can_approve_pull_request_reviews_| boolean | If actions can approve and merge pull requests ||
|_enabled_repositories_| string | Defines which repositories are permitted to use GitHub Actions |`all`, `none` or `selected`|
47
+
|_selected_repositories_| list[string]| The list of repositories that are permitted to use GitHub Actions | Only taken into account when `enabled_repositories` is set to `selected`|
48
+
|_allowed_actions_| string | Defines which type of GitHub Actions are permitted to run |`all`, `local_only` or `selected`|
49
+
|_allow_github_owned_actions_| boolean | If GitHub owned actions are permitted to run | Only taken into account when `allowed_actions` is set to `selected`|
50
+
|_allow_verified_creator_actions_| boolean | If GitHub Actions from verified creators are permitted to run | Only taken into account when `allowed_actions` is set to `selected`|
51
+
|_allow_action_patterns_| list[string]| A list of action patterns permitted to run | Only taken into account when `allowed_actions` is set to `selected`|
52
+
|_default_workflow_permissions_| string | The default workflow permissions granted to the GITHUB_TOKEN |`read` or `write`|
53
+
|_actions_can_approve_pull_request_reviews_| boolean | If actions can approve and merge pull requests ||
54
+
|_fork_pr_approval_policy_| string | Controls when fork PR workflows require approval from a maintainer |`first_time_contributors_new_to_github`, `first_time_contributors` or `all_external_contributors`|
0 commit comments